-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gcp-build samples #710
Changes from 1 commit
50bbc20
e07b3e4
cca79ce
8ab351e
76d2c2a
a51b060
24e8d4f
28652a9
bdd8076
8caaccd
36262e8
9792a12
6eaefb9
2c52716
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Exclude compiled .js files | ||
*.js | ||
|
||
# Exclude dependencies | ||
node_modules/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Exclude compiled .js files | ||
*.js | ||
|
||
# Exclude dependencies | ||
node_modules/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
runtime: nodejs8 | ||
|
||
handlers: | ||
- url: /.* | ||
secure: always | ||
script: auto | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2018 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the 'License'); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an 'AS IS' BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/* tslint:disable:no-console no-var-requires */ | ||
|
||
declare var require: any; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can do better as a TS example. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it is largely a copy-paste as I'm not terribly familiar with Typescript 😛 @JustinBeckwith is our resident TS expert, so I'll see what he suggests. |
||
declare var process: { | ||
env: { | ||
PORT: string, | ||
}, | ||
}; | ||
|
||
const PORT = process.env.PORT || 8080; | ||
const express = require("express"); | ||
|
||
const app = express(); | ||
|
||
app.get("/", (req, res) => { | ||
res.send("🎉 Hello TypeScript! 🎉"); | ||
}); | ||
|
||
const server = app.listen(PORT, () => { | ||
console.log(`App listening on port ${PORT}`); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "appengine-typescript", | ||
"description": "An example TypeScript app running on Google App Engine.", | ||
"version": "0.0.1", | ||
"private": true, | ||
"license": "Apache Version 2.0", | ||
"author": "Google Inc.", | ||
"engines": { | ||
"node": "8.x" | ||
}, | ||
"scripts": { | ||
"lint": "tslint index.ts", | ||
"start": "node ./index.js", | ||
"gcp-build": "tsc index.ts" | ||
}, | ||
"dependencies": { | ||
"express": "^4.16.3", | ||
"typescript": "^3.0.1" | ||
}, | ||
"devDependencies": { | ||
"semistandard": "^12.0.1", | ||
"tslint": "^5.11.0" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "tslint:recommended" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove handlers, they are optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you push the commit?