This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
6,508 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Backend | ||
SERVER_PORT=1337 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,45 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# 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 | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://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 | ||
# OS generated files # | ||
###################### | ||
.DS_Store | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
Desktop.ini | ||
ehthumbs.db | ||
Thumbs.db | ||
|
||
# Jetbrain IDEs (WebStorm, PhpStorm, etc.) # | ||
############################################ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# Eclipse IDE # | ||
############### | ||
.project | ||
.externalToolBuilders/ | ||
.settings/ | ||
|
||
# SublimeText project files # | ||
############################# | ||
*.sublime-workspace | ||
*.sublime-project | ||
|
||
# VSCODE project files # | ||
######################## | ||
.vscode/ | ||
|
||
# Node # | ||
######### | ||
node_modules | ||
npm-debug.log | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
*.log | ||
|
||
# dotenv environment variables file | ||
# Project # | ||
########### | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
local.* | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "presets": ["@babel/preset-env"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# IDE files | ||
.idea | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# Commenting this out is preferred by some people, see | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git | ||
node_modules | ||
|
||
# Users Environment Variables | ||
.lock-wscript | ||
|
||
# Runtime configuration for swagger app | ||
config/runtime.yaml | ||
|
||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM node:lts-alpine AS build | ||
WORKDIR /app | ||
COPY package.json package-lock.json ./ | ||
RUN npm ci | ||
COPY src ./src | ||
COPY test ./test | ||
COPY config ./config | ||
COPY .babelrc ./ | ||
|
||
FROM build AS dev | ||
COPY nodemon.json ./ | ||
CMD ["npm", "run", "dev"] | ||
|
||
# Run unit tests with code coverage before building release image: | ||
FROM build AS test | ||
CMD ["npm", "test"] | ||
|
||
FROM build AS release | ||
COPY src/app.swagger.yaml ./src/app.swagger.yaml | ||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
swagger: { | ||
appRoot: path.join(__dirname, '../'), | ||
swaggerFile: path.join(__dirname, '../src/app.swagger.yaml'), | ||
basePath: '/api', | ||
}, | ||
server: { | ||
host: '0.0.0.0', | ||
port: process.env.SERVER_PORT || 1337, | ||
}, | ||
db: { | ||
uri: process.env.DB_URI || 'mongodb://localhost:27017/app', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# swagger configuration file | ||
# See: https://github.com/swagger-api/swagger-node/blob/master/docs/configuration.md | ||
# values in the swagger hash are system configuration for swagger-node | ||
swagger: | ||
fittingsDirs: [src/fittings] | ||
defaultPipe: null | ||
swaggerControllerPipe: swagger_controllers # defines the standard processing pipe for controllers | ||
|
||
# values defined in the bagpipes key are the bagpipes pipes and fittings definitions | ||
# (see https://github.com/apigee-127/bagpipes) | ||
bagpipes: | ||
_router: | ||
name: swagger_router | ||
mockMode: false | ||
mockControllersDirs: [src/mocks] | ||
controllersDirs: [src/controllers] | ||
|
||
_swagger_validate: | ||
name: swagger_validator | ||
validateResponse: true | ||
|
||
# pipe for all swagger-node controllers | ||
swagger_controllers: | ||
- onError: json_error_handler | ||
- cors | ||
- swagger_security | ||
- _swagger_validate | ||
- express_compatibility | ||
- _router | ||
|
||
# pipe to serve swagger (endpoint is in swagger.yaml) | ||
swagger_raw: | ||
name: swagger_raw | ||
# any other values in this file are just loaded into the config for application access... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"watch": ["src", "config", "test"], | ||
"ext": "js,yaml", | ||
"exec": "babel-node src/app.js" | ||
} |
Oops, something went wrong.