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
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
{ | |
"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
{ | |
"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
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
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
version: '3.5' | |
services: | |
gateway: | |
image: nginx:1.11 | |
ports: | |
- 80:80 | |
- 443:443 | |
volumes: | |
- ./proxy/default.conf:/etc/nginx/conf.d/default.conf:ro | |
- ./proxy/ssl:/etc/nginx/ssl:ro |
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
ssl_certificate /etc/nginx/ssl/pac.crt; | |
ssl_certificate_key /etc/nginx/ssl/pac.key; | |
server { | |
server_name ms-commerce.com; | |
listen 80; | |
listen 443 ssl; | |
location / { | |
proxy_pass http://ms_commerce_client:3003; | |
proxy_http_version 1.1; |
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 mysql = require('mysql2/promise'); | |
const config = { | |
user: 'root', | |
password: 'root', | |
database: 'testdb', | |
host: 'mysql', | |
connectTimeout: 80000, | |
}; | |
mysql.createConnection(config) | |
.then((connection) => { |
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 ./package.json . | |
# npm install | |
RUN apt-get update && npm install |