Skip to content

Instantly share code, notes, and snippets.

View tkssharma's full-sized avatar
🎯
only JS

codewithtkssharma tkssharma

🎯
only JS
View GitHub Profile
FROM node:carbon
# Create app directory
WORKDIR /usr/src/app
# Bundle app source
COPY . .
# npm install
RUN npm install
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();
}
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"pretty": true,
"sourceMap": true,
"target": "es6",
"outDir": "./dist",
"experimentalDecorators": false,
"emitDecoratorMetadata": false,
{
"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",
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(
let arr = [1,2,3];
let arr2 = [4,5];
arr = arr.concat(arr2);
console.log(arr); // [ 1, 2, 3, 4, 5 ]
// 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 ]
let arr = ['a','b'];
let arr2 = [arr,'c','d'];
console.log(arr2); // [ [ 'a', 'b' ], 'c', 'd' ]
// expand using spread operator
let arr = ['a','b'];
let arr2 = [...arr,'c','d'];
console.log(arr2); // [ 'a', 'b', 'c', 'd' ]
stages:
- build
- deploy
build prod:
image: node:10.15.0-stretch
stage: build
only:
- tags
script: