Before you can run or deploy the sample, you will need to do the following:
-
Enable the Cloud Pub/Sub API in the Google Developers Console.
-
Create a topic and subscription.
$ gcloud alpha pubsub topics create [your-topic-name] $ gcloud alpha pubsub subscriptions create [your-subscription-name] \ --topic [your-topic-name] \ --push-endpoint \ https://[your-app-id].appspot.com/pubsub/push?token=[your-token] \ --ack-deadline 30
-
Update the environment variables in
app.yaml
.
Deploy using gcloud
:
gcloud app deploy app.yaml
You can now access the application at https://your-app-id.appspot.com
. You can use the form to submit messages, but it's non-deterministic which instance of your application will receive the notification. You can send multiple messages and refresh the page to see the received message.