Minimal boilerplate for a Node.js app running on AppEngine.
First, install dependencies:
yarn
Then run the development server:
yarn run dev
After deploying, Google App Engine executes npm run start
, so you need to be sure the start
script in
package.json does what you want:
npm run start
# or
yarn run start
Then to deploy you'll need the gcloud
command-line utility. Go to cloud.google.com/sdk/install to
install it.
Next, you'll need a Project ID. If you don't already have a project, create one via the GCP Console.
Then go into the package.json file and replace <project-id>
with your project ID from the GCP Console
in the deploy scripts:
{
// ...
"scripts": {
"deploy": "gcloud app deploy app.yaml --no-promote --project=<project-id>",
"deploy:quiet": "gcloud app deploy app.yaml --quiet --no-promote --project=<project-id>"
},
// ...
}
Then run the deploy
script:
yarn run deploy
Or, to deploy without asking questions, run the quiet version:
yarn run deploy:quiet