parent
62d67e3bf7
commit
315bcb23a7
@ -0,0 +1,19 @@ |
||||
{ |
||||
"scripts": { |
||||
"build": "tsc", |
||||
"start:dev": "tsc-watch --onSuccess \"node dist/app.js\"", |
||||
"prestart": "npm run build", |
||||
"start": "node dist/app.js" |
||||
}, |
||||
"devDependencies": { |
||||
"@types/express": "^5.0.2", |
||||
"@types/node": "^15.3.0", |
||||
"prettier": "^2.2.1", |
||||
"tsc": "^2.0.3", |
||||
"tsc-watch": "^4.2.9", |
||||
"typescript": "^4.3.4" |
||||
}, |
||||
"dependencies": { |
||||
"express": "^5.1.0" |
||||
} |
||||
} |
@ -0,0 +1,13 @@ |
||||
import * as express from "express"; |
||||
|
||||
const app: express.Express = express(); |
||||
const port: number = 8000; |
||||
|
||||
app.get("/", (req: express.Request, res: express.Response) => { |
||||
console.log(req); |
||||
res.send("Hello World!"); |
||||
}); |
||||
|
||||
app.listen(port, () => { |
||||
console.log(`Example app listening at http://localhost:${port}`); |
||||
}); |
@ -0,0 +1,20 @@ |
||||
//* https://www.staging-typescript.org/tsconfig |
||||
|
||||
{ |
||||
"compilerOptions": { |
||||
"strict": true, |
||||
"module": "commonjs", |
||||
"declaration": true, |
||||
"removeComments": true, |
||||
"emitDecoratorMetadata": true, |
||||
"experimentalDecorators": true, |
||||
"allowSyntheticDefaultImports": true, |
||||
"target": "ES5", |
||||
"sourceMap": true, |
||||
"outDir": "./dist", |
||||
"baseUrl": "./src", |
||||
"incremental": true |
||||
}, |
||||
"include": ["src/**/*"] |
||||
} |
||||
|
Loading…
Reference in new issue