From 154b732540ca79f06eecb6a78a6d1cf2e18b3816 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Tue, 29 Jan 2019 12:45:38 -0800 Subject: [PATCH] Deploy staging on App Engine standard --- app-staging.yaml | 15 +++++---------- modules/server.js | 6 ++++++ package.json | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app-staging.yaml b/app-staging.yaml index 1957016..7fdf95c 100644 --- a/app-staging.yaml +++ b/app-staging.yaml @@ -1,10 +1,5 @@ -runtime: nodejs -env: flex - -resources: - cpu: 1 - memory_gb: 0.5 - disk_size_gb: 10 - -manual_scaling: - instances: 1 +runtime: nodejs10 +env: standard +instance_class: B4 +basic_scaling: + max_instances: 1 diff --git a/modules/server.js b/modules/server.js index b43eb4e..19cd33d 100644 --- a/modules/server.js +++ b/modules/server.js @@ -29,6 +29,12 @@ app.enable('trust proxy'); app.use(logger); app.use(staticFiles); +// Special startup request from App Engine +// https://cloud.google.com/appengine/docs/standard/nodejs/how-instances-are-managed +app.get('/_ah/start', (req, res) => { + res.status(200).end(); +}); + app.get('/', serveMainPage); app.use(redirectLegacyURLs); diff --git a/package.json b/package.json index 80b0bad..1aca617 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,6 @@ "tempy": "^0.2.1" }, "engines": { - "node": "10.x" + "node": "10.x.x" } }