This is a sample application for node.js run on Google App Engine Standard environment. A main focus of this application is a useful and extensional project configuration.
- Google Cloud SDK
- Node.js v10
- yarn
- git CLI
- A project of Google Cloud Platform
- If you are newbie of GCP/GAE, access https://cloud.google.com and create a new project.
npm install -g yarn
yarn install
- Access to GCP console and create your GCP project.
- Create a service account and save credentials.
- Copy server/src/server-config.template.ts to server/src/server-config.ts and add credentials as below:
export class ServerConfig {
static PRODUCTION = {
"type": "service_account",
"project_id": "PROJECT_NAME",
"private_key_id": "xxxx",
"private_key": "xxxx",
"client_email": "xxxx",
"client_id": "xxxx",
"auth_uri": "xxxx",
"token_uri": "xxxx",
"auth_provider_x509_cert_url": "xxxx",
"client_x509_cert_url": "xxxx"
};
}
yarn run serve
- Replace
PROJECT_NAME
to your project name in package.json. gcloud config configurations create PROJECT_NAME
gcloud config configurations activate PROJECT_NAME
gcloud auth login
yarn run deploy
You can access your application on https://${PROJECT_NAME}.appspot.com.
- microsoft/TypeScript#842
- There is shared TypeScript code on this project, but "@types/node" has a incompatible
setTimeout
signature which cannot run on browser.
- There is shared TypeScript code on this project, but "@types/node" has a incompatible