├── .gitignore ├── .prettierrc ├── src └── server.ts ├── tslint.json ├── tsconfig.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "singleQuote": true, 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/server.ts: -------------------------------------------------------------------------------- 1 | import cors from 'cors'; 2 | import express from 'express'; 3 | 4 | const app = express(); 5 | app.use(cors()); 6 | app.get('/', (req, res) => res.send({ hello: 'world' })); 7 | app.listen(3000, () => console.log('Example app listening on port 3000!')); 8 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultSeverity": "error", 3 | "extends": [ 4 | "tslint:recommended", 5 | "tslint-config-prettier" 6 | ], 7 | "jsRules": {}, 8 | "rules": { 9 | "prettier": true, 10 | "interface-name": false, 11 | "no-console": false, 12 | "quotemark": [true, "single"] 13 | }, 14 | "rulesDirectory": [ 15 | "tslint-plugin-prettier" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "esModuleInterop": true, 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "moduleResolution": "node", 8 | "sourceMap": true, 9 | "outDir": "dist", 10 | "baseUrl": ".", 11 | "paths": { 12 | "*": [ 13 | "node_modules/*", 14 | "src/types/*" 15 | ] 16 | }, 17 | "lib": [ 18 | "es2015", 19 | "esnext" 20 | ] 21 | }, 22 | "include": [ 23 | "src/**/*" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tech-stack-2019-backend", 3 | "version": "1.0.0", 4 | "description": "", 5 | "private": true, 6 | "scripts": { 7 | "build-ts": "tsc", 8 | "start": "npm run serve", 9 | "serve": "npm run build-ts && node dist/server.js", 10 | "watch-node": "nodemon dist/server.js", 11 | "watch-ts": "tsc -w", 12 | "lint": "tslint -c tslint.json 'src/**/*.ts'", 13 | "test": "echo \"Success: no test specified\" && exit 0", 14 | "watch": "npm run build-ts && concurrently 'npm:watch-ts' 'npm:watch-node'" 15 | }, 16 | "author": "", 17 | "license": "ISC", 18 | "devDependencies": { 19 | "concurrently": "^4.1.0", 20 | "husky": "^1.3.1", 21 | "lint-staged": "^8.1.0", 22 | "nodemon": "^1.18.6", 23 | "prettier": "^1.15.3", 24 | "tslint": "^5.11.0", 25 | "tslint-config-prettier": "^1.17.0", 26 | "tslint-plugin-prettier": "^2.0.1", 27 | "typescript": "^3.1.6" 28 | }, 29 | "dependencies": { 30 | "@types/cors": "^2.8.4", 31 | "@types/express": "^4.16.0", 32 | "cors": "^2.8.5", 33 | "express": "^4.16.4" 34 | }, 35 | "husky": { 36 | "hooks": { 37 | "pre-commit": "export CI=true && npm run build-ts && lint-staged && npm test", 38 | "pre-push": "export CI=test && npm run build-ts && lint-staged && npm test" 39 | } 40 | }, 41 | "lint-staged": { 42 | "*.ts": [ 43 | "tslint -c tslint.json" 44 | ] 45 | } 46 | } 47 | --------------------------------------------------------------------------------