Skip to content

Commit

Permalink
feat: implemented support for fastify
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyLzq committed Jan 27, 2022
1 parent dda2eee commit 2a9c939
Show file tree
Hide file tree
Showing 90 changed files with 6,027 additions and 95 deletions.
1 change: 0 additions & 1 deletion example/CHANGELOG.md

This file was deleted.

3 changes: 0 additions & 3 deletions example/README.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions example/express/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Example/express
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions example/express/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Example/express

This is a test using express.
File renamed without changes.
6 changes: 3 additions & 3 deletions example/index.http → example/express/index.http
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ GET http://localhost:1996/api/users
DELETE http://localhost:1996/api/users

### Testing getOne user
GET http://localhost:1996/api/user/61f0dd3c921b7811b4640dd3
GET http://localhost:1996/api/user/61f22214f84325c16f8d9ae6

### Testing update user
PATCH http://localhost:1996/api/user/61f0dd3c921b7811b4640dd3
PATCH http://localhost:1996/api/user/61f22214f84325c16f8d9ae6
Content-Type: application/json

{
Expand All @@ -30,4 +30,4 @@ Content-Type: application/json
}

### Testing delete user
DELETE http://localhost:1996/api/user/61f0dd3c921b7811b4640dd3
DELETE http://localhost:1996/api/user/61f22214f84325c16f8d9ae6
File renamed without changes.
6 changes: 3 additions & 3 deletions example/package.json → example/express/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "example",
"name": "example-express",
"version": "0.1.0",
"main": "src/index.ts",
"description": "This is a test",
"description": "This is a test using express",
"scripts": {
"build:dev": "webpack --mode development",
"build": "webpack --mode production",
Expand All @@ -16,7 +16,7 @@
"dependencies": {
"express": "^4.17.2",
"http-errors": "^2.0.0",
"joi": "^17.5.0",
"joi": "^17.6.0",
"mongoose": "^6.1.8",
"morgan": "^1.10.0",
"swagger-ui-express": "^4.3.0"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"openapi": "3.0.0",
"info": {
"title": "example",
"title": "example/express",
"description": "Documentation of the test",
"contact": {
"email": "sluzquinosa@uni.pe"
Expand All @@ -10,12 +10,12 @@
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
},
"version": "0.1.0"
"version": "undefined"
},
"servers": [
{
"url": "http://localhost:1996/api",
"description": "example local API"
"description": "example/express local API"
}
],
"tags": [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 13 additions & 13 deletions example/yarn.lock → example/express/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
"@hapi/hoek" "^9.0.0"

"@humanwhocodes/config-array@^0.9.2":
version "0.9.2"
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914"
integrity sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==
version "0.9.3"
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.3.tgz#f2564c744b387775b436418491f15fce6601f63e"
integrity sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ==
dependencies:
"@humanwhocodes/object-schema" "^1.2.1"
debug "^4.1.1"
Expand Down Expand Up @@ -1347,9 +1347,9 @@ ee-first@1.1.1:
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=

electron-to-chromium@^1.4.17:
version "1.4.53"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.53.tgz#5d80a91c399b44952ef485857fb5b9d4387d2e60"
integrity sha512-rFveSKQczlcav+H3zkKqykU6ANseFwXwkl855jOIap5/0gnEcuIhv2ecz6aoTrXavF6I/CEBeRnBnkB51k06ew==
version "1.4.54"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.54.tgz#69005d39ed11542e1bcb65ec1a98e44d39527ba8"
integrity sha512-jRAoneRdSxnpRHO0ANpnEUtQHXxlgfVjrLOnQSisw1ryjXJXvS0pJaR/v2B7S++/tRjgEDp4Sjn5nmgb6uTySw==

emoji-regex@^8.0.0:
version "8.0.0"
Expand Down Expand Up @@ -1831,9 +1831,9 @@ flat-cache@^3.0.4:
rimraf "^3.0.2"

flatted@^3.1.0:
version "3.2.4"
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2"
integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==
version "3.2.5"
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3"
integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==

forwarded@0.2.0:
version "0.2.0"
Expand Down Expand Up @@ -2438,10 +2438,10 @@ jest-worker@^27.4.1:
merge-stream "^2.0.0"
supports-color "^8.0.0"

joi@^17.5.0:
version "17.5.0"
resolved "https://registry.yarnpkg.com/joi/-/joi-17.5.0.tgz#7e66d0004b5045d971cf416a55fb61d33ac6e011"
integrity sha512-R7hR50COp7StzLnDi4ywOXHrBrgNXuUUfJWIR5lPY5Bm/pOD3jZaTwpluUXVLRWcoWZxkrHBBJ5hLxgnlehbdw==
joi@^17.6.0:
version "17.6.0"
resolved "https://registry.yarnpkg.com/joi/-/joi-17.6.0.tgz#0bb54f2f006c09a96e75ce687957bd04290054b2"
integrity sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==
dependencies:
"@hapi/hoek" "^9.0.0"
"@hapi/topo" "^5.0.0"
Expand Down
1 change: 1 addition & 0 deletions example/fastify/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/dist
67 changes: 67 additions & 0 deletions example/fastify/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"env": {
"node": true
},
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "import", "prettier"],
"extends": [
"standard",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-interface": "off",
"arrow-parens": ["error", "as-needed"],
"import/extensions": [
2,
{
"ts": "never",
"js": "always",
"json": "always"
}
],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": ["**/*.test.js", "webpack.config.js"],
"optionalDependencies": ["**/*.test.js"],
"peerDependencies": ["**/*.test.js"]
}
],
"max-len": [
"error",
{
"code": 80,
"ignoreComments": true,
"ignoreRegExpLiterals": true,
"ignoreTemplateLiterals": true,
"ignoreTrailingComments": true,
"ignoreStrings": true,
"ignoreUrls": true
}
],
"newline-before-return": "error",
"object-curly-spacing": ["error", "always"],
"object-shorthand": ["error", "always"],
"prefer-const": "error",
"prettier/prettier": [
"error",
{
"arrowParens": "avoid",
"bracketSpacing": true,
"printWidth": 80,
"quoteProps": "as-needed",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none"
}
],
"radix": ["error", "as-needed"],
"spaced-comment": ["error", "always"]
}
}
128 changes: 128 additions & 0 deletions example/fastify/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Created by https://www.toptal.com/developers/gitignore/api/node,yarn
# Edit at https://www.toptal.com/developers/gitignore?templates=node,yarn

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode*

### yarn ###
# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored

# .yarn/unplugged and .yarn/build-state.yml should likely always be ignored since
# they typically hold machine-specific build artifacts. Ignoring them might however
# prevent Zero-Installs from working (to prevent this, set enableScripts to false).
.yarn/unplugged
.yarn/build-state.yml

# .yarn/cache and .pnp.* may be safely ignored, but you'll need to run yarn install
# to regenerate them between each branch switch.
# Uncomment the following lines if you're not using Zero-Installs:
# .yarn/cache
# .pnp.*

# End of https://www.toptal.com/developers/gitignore/api/node,yarn

dist
1 change: 1 addition & 0 deletions example/fastify/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Example/fastify
17 changes: 17 additions & 0 deletions example/fastify/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:16-alpine

WORKDIR /app

COPY package.json ./

RUN yarn install --prod

RUN yarn add webpack webpack-node-externals tsconfig-paths-webpack-plugin -D

RUN yarn build

RUN yarn remove webpack webpack-node-externals tsconfig-paths-webpack-plugin

COPY dist /app/dist

CMD [ "yarn", "start" ]
21 changes: 21 additions & 0 deletions example/fastify/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 AnthonyLzq

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions example/fastify/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Example/fastify

This is a test using fastify.
3 changes: 3 additions & 0 deletions example/fastify/heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build:
docker:
web: Dockerfile
Loading

0 comments on commit 2a9c939

Please sign in to comment.