File tree 4 files changed +24
-16
lines changed
4 files changed +24
-16
lines changed Original file line number Diff line number Diff line change 12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- /* tslint:disable:no-console */
15
+ const PORT = Number ( process . env . PORT ) || 8080 ;
16
+ import * as express from "express" ;
16
17
17
- declare var process : {
18
- env : {
19
- PORT : string ,
20
- } ,
21
- } ;
18
+ const app = express ( ) ;
22
19
23
- const PORT : number = Number ( process . env . PORT ) || 8080 ;
24
- import express = require( "express" ) ;
25
-
26
- const app : any = express ( ) ;
27
-
28
- app . get ( "/" , ( req : any , res : any ) => {
20
+ app . get ( "/" , ( req , res ) => {
29
21
res . send ( "🎉 Hello TypeScript! 🎉" ) ;
30
22
} ) ;
31
23
Original file line number Diff line number Diff line change 9
9
"node" : " >=8.0.0"
10
10
},
11
11
"scripts" : {
12
- "test" : " npm run gcp-build && npm run lint && repo-tools test app -- index.js" ,
13
- "lint" : " tslint index.ts" ,
12
+ "prepare" : " npm run gcp-build" ,
13
+ "pretest" : " npm run gcp-build" ,
14
+ "test" : " repo-tools test app -- index.js" ,
15
+ "posttest" : " npm run lint" ,
16
+ "lint" : " tslint -p ." ,
14
17
"start" : " node ./index.js" ,
15
- "gcp-build" : " tsc index.ts " ,
18
+ "gcp-build" : " tsc -p . " ,
16
19
"deploy" : " gcloud app deploy"
17
20
},
18
21
"dependencies" : {
21
24
},
22
25
"devDependencies" : {
23
26
"@google-cloud/nodejs-repo-tools" : " ^2.3.3" ,
27
+ "@types/express" : " ^4.16.0" ,
24
28
"tslint" : " ^5.11.0"
25
29
}
26
30
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "target" : " es2016" ,
4
+ "module" : " commonjs"
5
+ },
6
+ "include" : [
7
+ " *.ts"
8
+ ]
9
+ }
Original file line number Diff line number Diff line change 1
1
{
2
- "extends" : " tslint:recommended"
2
+ "extends" : " tslint:recommended" ,
3
+ "rules" : {
4
+ "no-console" : false
5
+ }
3
6
}
You can’t perform that action at this time.
0 commit comments