Hanzo chat app.
In general, Node.js projects require:
-
Install the Google Cloud SDK, including the gcloud tool, and gcloud app component.
-
Setup the gcloud tool. This provides authentication to Google Cloud APIs and services.
gcloud init -
Acquire local credentials for autheticating with Google Cloud Platform APIs:
gcloud beta auth application-default login -
Install depedencies using
npmoryarn:npm installor
yarn install -
Run the sample with
npmoryarn:npm startor
yarn start -
Visit the application at http://localhost:8080.
-
Use the Google Developers Console to create a project/app id. (App id and project id are identical.)
-
Setup the gcloud tool, if you haven't already.
gcloud init -
Use gcloud to deploy your app.
gcloud app deployNote: If there is a
yarn.lockfile thenyarn installwill be used during deployment. Delete theyarn.lockfile to fall back tonpm install. -
Awesome! Your application is now live at
https://YOUR_PROJECT_ID.appspot.com.
You will need to create a new firewall rule to allow traffic on port 65080. This port will be used for websocket connections. You can do this with the Google Cloud SDK with the following command:
gcloud compute firewall-rules create default-allow-websockets \
--allow tcp:65080 \
--target-tags websocket \
--description "Allow websocket traffic on port 65080"