File tree Expand file tree Collapse file tree 6 files changed +812
-0
lines changed
Expand file tree Collapse file tree 6 files changed +812
-0
lines changed Original file line number Diff line number Diff line change 1+ node_modules /
2+ package-lock.json
3+ .vscode /settings.json
Original file line number Diff line number Diff line change 1+ {
2+ "version" : " 0.2.0" ,
3+ "configurations" : [
4+ {
5+ "name" : " Launch Server" ,
6+ "type" : " node" ,
7+ "request" : " launch" ,
8+ "runtimeExecutable" : " npm" ,
9+ "runtimeArgs" : [" run" , " dev" ]
10+ }
11+ ]
12+ }
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " @idea2app/rest-node-ts" ,
3+ "version" : " 0.1.0" ,
4+ "license" : " LGPL-3.0" ,
5+ "author" : " shiy2008@gmail.com" ,
6+ "description" : " " ,
7+ "homepage" : " https://github.com/idea2app/REST-Node-ts#readme" ,
8+ "repository" : {
9+ "type" : " git" ,
10+ "url" : " git+https://github.com/idea2app/REST-Node-ts.git"
11+ },
12+ "bugs" : {
13+ "url" : " https://github.com/idea2app/REST-Node-ts/issues"
14+ },
15+ "source" : " source/index.ts" ,
16+ "main" : " dist/index.js" ,
17+ "engines" : {
18+ "node" : " ^14.0.0"
19+ },
20+ "dependencies" : {
21+ "koa" : " ^2.13.4"
22+ },
23+ "devDependencies" : {
24+ "@types/koa" : " ^2.13.4" ,
25+ "ts-node-dev" : " ^1.1.8" ,
26+ "typescript" : " ^4.6.3"
27+ },
28+ "scripts" : {
29+ "dev" : " ts-node-dev source/" ,
30+ "test" : " echo \" Error: no test specified\" && exit 1"
31+ }
32+ }
Original file line number Diff line number Diff line change 1+ import Koa from "koa" ;
2+
3+ const { PORT = 8080 } = process . env ;
4+
5+ const HOST = `http://localhost:${ PORT } ` ,
6+ app = new Koa ( ) ;
7+
8+ console . time ( "HTTP boot" ) ;
9+
10+ app . listen ( PORT , ( ) => {
11+ console . log ( `
12+ HTTP served at ${ HOST }
13+ ` ) ;
14+ console . timeEnd ( "HTTP boot" ) ;
15+ } ) ;
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "target" : " ES2017" ,
4+ "module" : " CommonJS" ,
5+ "moduleResolution" : " Node" ,
6+ "esModuleInterop" : true
7+ }
8+ }
You can’t perform that action at this time.
0 commit comments