├── .gitignore ├── src └── server.ts ├── tslint.json ├── tsconfig.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | -------------------------------------------------------------------------------- /src/server.ts: -------------------------------------------------------------------------------- 1 | import express from 'express'; 2 | const app = express(); 3 | 4 | app.get('/', (req, res) => res.send('Hello World!')); 5 | 6 | app.listen(3000, () => console.log('Example app listening on port 3000!')); 7 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultSeverity": "error", 3 | "extends": [ 4 | "tslint:recommended" 5 | ], 6 | "jsRules": {}, 7 | "rules": { 8 | "interface-name": [false], 9 | "no-console": [false], 10 | "quotemark": [true, "single"] 11 | }, 12 | "rulesDirectory": [] 13 | } -------------------------------------------------------------------------------- /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 | ] 20 | }, 21 | "include": [ 22 | "src/**/*" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hello-nodejs-typescript", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "dist/server.js", 6 | "scripts": { 7 | "build-ts": "tsc", 8 | "start": "npm run serve", 9 | "serve": "node dist/server.js", 10 | "watch-node": "nodemon dist/server.js", 11 | "watch-ts": "tsc -w" 12 | }, 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "nodemon": "^1.18.3", 17 | "tslint": "^5.11.0", 18 | "typescript": "^3.0.1" 19 | }, 20 | "dependencies": { 21 | "@types/express": "^4.16.0", 22 | "express": "^4.16.3" 23 | } 24 | } 25 | --------------------------------------------------------------------------------