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:carbon | |
# Create app directory | |
WORKDIR /usr/src/app | |
# Bundle app source | |
COPY . . | |
# npm install | |
RUN npm install |
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 express from "express"; | |
import * as bodyParser from "body-parser"; | |
import { Request, Response } from "express"; | |
class App { | |
constructor() { | |
this.app = express(); | |
this.config(); | |
this.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
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"moduleResolution": "node", | |
"pretty": true, | |
"sourceMap": true, | |
"target": "es6", | |
"outDir": "./dist", | |
"experimentalDecorators": false, | |
"emitDecoratorMetadata": false, |
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": "bla-bla-scooty", | |
"version": "0.0.0", | |
"private": true, | |
"scripts": { | |
"start-dev": ". ./env.sh && cd dist && nodemon server.js", | |
"start": "cd dist && nodemon server.js", | |
"test": ". ./env.sh && NODE_ENV=test && mocha ", | |
"build": "tsc --watch", | |
"dev": ". ./env.sh && ts-node server.ts", |
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
const newman = require('../../node_modules/newman'); | |
const treeify = require('treeify'); | |
const { app } = require('../../app/server'); | |
const collection = require('../collections/collection.json'); | |
const environment = require('../collections/environment.json'); | |
const port = 3333; | |
environment.values[0].value = `http://localhost:${port}/api/v1`; | |
const server = app.listen( |
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
let arr = [1,2,3]; | |
let arr2 = [4,5]; | |
arr = arr.concat(arr2); | |
console.log(arr); // [ 1, 2, 3, 4, 5 ] |
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
// spread operator doing the concat job | |
let arr = [1,2,3]; | |
let arr2 = [4,5]; | |
arr = [...arr,...arr2]; | |
console.log(arr); // [ 1, 2, 3, 4, 5 ] |
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
let arr = ['a','b']; | |
let arr2 = [arr,'c','d']; | |
console.log(arr2); // [ [ 'a', 'b' ], 'c', 'd' ] |
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
// expand using spread operator | |
let arr = ['a','b']; | |
let arr2 = [...arr,'c','d']; | |
console.log(arr2); // [ 'a', 'b', 'c', 'd' ] |
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
stages: | |
- build | |
- deploy | |
build prod: | |
image: node:10.15.0-stretch | |
stage: build | |
only: | |
- tags | |
script: |