This file contains hidden or 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
| var machineId = (function() { | |
| var n = require("os").networkInterfaces(), | |
| x = {}; | |
| return Object.keys(n).filter(function(v) { | |
| return !n[v].forEach(function(v) { | |
| v.mac.substr(0, v.mac.indexOf(":")) !== "00" && (x[v.mac] = 1) | |
| }) | |
| }), Object.keys(x) | |
| })().split(":").filter(function(v) { |
This file contains hidden or 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
| { | |
| "name": "gateway", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "src/server.ts", | |
| "scripts": { | |
| "start": "ts-node src/server.ts", | |
| "build:watch": "onchange 'src/**/*.ts' -- npm run build", | |
| "build": "tsc" | |
| }, |
This file contains hidden or 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
Show hidden characters
| { | |
| "compilerOptions": { | |
| "module": "commonjs", | |
| "resolveJsonModule": true, | |
| "esModuleInterop": true, | |
| "target": "es6", | |
| "noImplicitAny": false, | |
| "sourceMap": false, | |
| "outDir": "build", | |
| "experimentalDecorators": true, |
This file contains hidden or 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
| import fastify from 'fastify'; | |
| export interface RouteSchema extends fastify.RouteSchema { | |
| tags?: string[]; | |
| body?: object; | |
| data?: object; | |
| params?: object; | |
| response?: any; | |
| description?: string; | |
| summary?: string; |
This file contains hidden or 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
| import fastify from 'fastify'; | |
| import { Server, IncomingMessage, ServerResponse } from 'http'; | |
| import fastifyFormbody from 'fastify-formbody'; | |
| import dotenv from 'dotenv'; | |
| import helmet from 'fastify-helmet'; | |
| import fastswagger from 'fastify-swagger'; | |
| dotenv.config({ path: __dirname + '/../.env' }); | |
| import routes from './routes'; |
This file contains hidden or 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
| class Requests { | |
| static requestBody(itemInterface, requiredValues ) { | |
| return { | |
| type: 'object', | |
| additionalProperties: false, | |
| properties: itemInterface, | |
| required: requiredValues | |
| } | |
| } | |
This file contains hidden or 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
| class Responses { | |
| static errorResponseObj(){ | |
| return { | |
| type: 'object', | |
| properties: { | |
| code: { type: 'number' }, | |
| message: { type: 'string' }, | |
| error: {type: 'string'} | |
| } | |
| } |
This file contains hidden or 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
| import * as fastify from 'fastify'; | |
| import Responses from '../../../utils/responses'; | |
| import {RouteSchema} from '../../../@types/routeschema'; | |
| import Requests from '../../../utils/requests'; | |
| import requestmaker from '../../../utils/requestmaker'; | |
| export default (app: fastify.FastifyInstance, options, done) => { | |
| const action = 'Auth'; | |
This file contains hidden or 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
| version: '3.7' | |
| services: | |
| app: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile-build | |
| image: gateway | |
| container_name: gateway | |
| restart: unless-stopped |
This file contains hidden or 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
| FROM node:12-alpine as builder | |
| RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app | |
| WORKDIR /home/node/app | |
| COPY package*.json ./ | |
| RUN npm config set unsafe-perm true | |
| RUN npm install -g typescript | |
| RUN npm install -g ts-node | |
| USER node | |
| RUN npm install | |
| COPY --chown=node:node . . |
OlderNewer