File tree Expand file tree Collapse file tree 10 files changed +66
-0
lines changed
Expand file tree Collapse file tree 10 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 1616require "sinatra"
1717require "net/http"
1818
19+ # [END gae_flex_analytics_track_event]
20+ # Allows all hosts in development
21+ configure :development do
22+ set :host_authorization , { permitted_hosts : [ ] }
23+ end
24+
25+ # [START gae_flex_analytics_track_event]
1926# The following environment variable is set by app.yaml when running on GAE,
2027# but will need to be manually set when running locally. See README.md.
2128GA_TRACKING_ID = ENV [ "GA_TRACKING_ID" ]
Original file line number Diff line number Diff line change 1818require "sinatra"
1919require "json"
2020
21+ # [END cloud_tasks_appengine_quickstart]
22+ # Allows all hosts in development
23+ configure :development do
24+ set :host_authorization , { permitted_hosts : [ ] }
25+ end
26+
27+ # [START cloud_tasks_appengine_quickstart]
2128get "/" do
2229 # Basic index to verify app is serving
2330 "Hello World!"
Original file line number Diff line number Diff line change 1717require "sinatra"
1818require "google/cloud/datastore"
1919
20+ # [END gae_flex_datastore_app]
21+ # Allows all hosts in development
22+ configure :development do
23+ set :host_authorization , { permitted_hosts : [ ] }
24+ end
25+
26+ # [START gae_flex_datastore_app]
2027get "/" do
2128 datastore = Google ::Cloud ::Datastore . new
2229
Original file line number Diff line number Diff line change 1515# [START gae_flex_quickstart]
1616require "sinatra"
1717
18+ # [END gae_flex_quickstart]
19+ # Allows all hosts in development
20+ configure :development do
21+ set :host_authorization , { permitted_hosts : [ ] }
22+ end
23+
24+ # [START gae_flex_quickstart]
1825get "/" do
1926 "Hello world!"
2027end
Original file line number Diff line number Diff line change 1616require "sinatra"
1717require "net/http"
1818
19+ # [END gae_flex_metadata]
20+ # Allows all hosts in development
21+ configure :development do
22+ set :host_authorization , { permitted_hosts : [ ] }
23+ end
24+
25+ # [START gae_flex_metadata]
1926get "/" do
2027 uri = URI . parse (
2128 "http://metadata.google.internal/computeMetadata/v1" +
Original file line number Diff line number Diff line change 2121
2222pubsub = Google ::Cloud ::Pubsub . new
2323
24+ # Allows all hosts in development
25+ configure :development do
26+ set :host_authorization , { permitted_hosts : [ ] }
27+ end
28+
2429# [START gae_flex_pubsub_env]
2530topic = pubsub . topic ENV [ "PUBSUB_TOPIC" ]
2631PUBSUB_VERIFICATION_TOKEN = ENV [ "PUBSUB_VERIFICATION_TOKEN" ]
Original file line number Diff line number Diff line change 1616require "sinatra"
1717require "net/http"
1818
19+ # [END gae_standard_metadata]
20+ # Allows all hosts in development
21+ configure :development do
22+ set :host_authorization , { permitted_hosts : [ ] }
23+ end
24+
25+ # [START gae_standard_metadata]
1926get "/" do
2027 uri = URI . parse (
2128 "http://metadata.google.internal/computeMetadata/v1" +
Original file line number Diff line number Diff line change 1616require "sinatra"
1717require "google/cloud/storage"
1818
19+ # [END gae_flex_storage_app]
20+ # Allows all hosts in development
21+ configure :development do
22+ set :host_authorization , { permitted_hosts : [ ] }
23+ end
24+
25+ # [START gae_flex_storage_app]
1926storage = Google ::Cloud ::Storage . new
2027bucket = storage . bucket ENV [ "GOOGLE_CLOUD_STORAGE_BUCKET" ]
2128
Original file line number Diff line number Diff line change 1515require "sinatra"
1616require "twilio-ruby"
1717
18+ # Allows all hosts in development
19+ configure :development do
20+ set :host_authorization , { permitted_hosts : [ ] }
21+ end
22+
1823TWILIO_ACCOUNT_SID = ENV [ "TWILIO_ACCOUNT_SID" ]
1924TWILIO_AUTH_TOKEN = ENV [ "TWILIO_AUTH_TOKEN" ]
2025TWILIO_NUMBER = ENV [ "TWILIO_NUMBER" ]
Original file line number Diff line number Diff line change 2121
2222Faye ::WebSocket . load_adapter "thin"
2323
24+ # [END gae_flex_websockets]
25+ # Allows all hosts in development
26+ configure :development do
27+ set :host_authorization , { permitted_hosts : [ ] }
28+ end
29+
30+ # [START gae_flex_websockets]
2431# For the purposes of this example, use a global variable to keep track of
2532# all connected clients in order to send chat messages. This approach limits
2633# us to a single server and a single process; a more robust solution would be
You can’t perform that action at this time.
0 commit comments