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": { | |
"emitDecoratorMetadata": true, | |
"experimentalDecorators": true, | |
"outDir": "./dist", | |
"moduleResolution": "node", | |
"baseUrl": "./src", | |
"sourceMap": true, | |
"pretty": true, | |
"strictNullChecks": 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
apps: | |
- script : 'app.js' | |
name : 'Backend To-do Application' | |
node_args : '--inspect=0.0.0.0:5858' |
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
{ | |
"defaultSeverity": "error", | |
"extends": [ | |
"tslint:recommended", | |
"tslint-eslint-rules" | |
], | |
"jsRules": {}, | |
"rules": { | |
"object-literal-shorthand": false, | |
"object-literal-sort-keys": [ |
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 chai = require("chai"); | |
import chaiAsPromised = require("chai-as-promised"); | |
import { suite, test } from "mocha-typescript"; | |
import testFunction from "../app"; | |
chai.use(chaiAsPromised); | |
@suite("User Test class") | |
class UserTests { | |
@test("testFunction Test - It works fine") |
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:8 | |
# Install gulp and pm2 globaly | |
RUN npm install --quiet -g gulp pm2 | |
# Create app directory | |
RUN mkdir -p /usr/src/ | |
WORKDIR /usr/src/ |
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' | |
services: | |
web: | |
build: . | |
command: npm run dev | |
volumes: | |
- .:/usr/src/ | |
- /usr/src/node_modules | |
ports: | |
- "3000:3000" |
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
"use strict"; | |
/* | |
Import modules | |
*/ | |
import bluebird = require("bluebird"); | |
import cors = require("cors"); | |
import express = require("express"); | |
import fs = require("fs"); | |
import mongoose = require("mongoose"); | |
import { Config } from "./shared"; |
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
/** | |
* This file stores info for api, db, keys, logs | |
* @constant Config | |
*/ | |
export const Config = { | |
apiSettings: { | |
host: process.env.API_HOST || "localhost", | |
}, | |
dbSettings: { | |
authEnabled: process.env.MONGO_AUTH || 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 chai = require("chai"); | |
import chaiAsPromised = require("chai-as-promised"); | |
import chaiHttp = require("chai-http"); | |
import { suite, test } from "mocha-typescript"; | |
import sinon = require("sinon"); | |
import { TodoApp } from "../server"; | |
import { Config } from "../shared"; | |
// starting the server | |
const server: TodoApp = new TodoApp(process.env.API_PORT || 3001); |
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 { GraphQLNonNull, GraphQLObjectType, GraphQLSchema } from "graphql"; | |
import { login, register } from "../routes"; | |
import { userLoginSchema } from "./userLoginSchema"; | |
import { userRegisterSchema } from "./userRegisterSchema"; | |
// Define the Query type | |
const queryType = new GraphQLObjectType({ | |
name: "Query", | |
fields: { | |
loginUser: { |