Skip to content

Instantly share code, notes, and snippets.

@thetminko
Last active May 21, 2019 08:23
Show Gist options
  • Save thetminko/19300ffbf8696a1b5d47b03bc50e5273 to your computer and use it in GitHub Desktop.
Save thetminko/19300ffbf8696a1b5d47b03bc50e5273 to your computer and use it in GitHub Desktop.
es6-ts
{
"name": "es6-ts",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"tsc": "tsc",
"start": "npm run tsc && node build/server.js",
"start-dev": "ts-node-dev --respawn --transpileOnly ./src/server.ts",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@types/express": "^4.16.1",
"express": "^4.17.0",
"ts-node-dev": "^1.0.0-pre.39",
"typescript": "^3.4.5"
}
}
import express = require('express');
// Create a new express application instance
const app: express.Application = express();
app.get('/', function (req, res) {
res.send('Hello World!');
});
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"esModuleInterop": true,
"alwaysStrict": true,
"noImplicitAny": false,
"noImplicitReturns": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"outDir": "build"
},
"include": [
"src/**/*.ts"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment