Skip to content

Commit

Permalink
update region tags (#709)
Browse files Browse the repository at this point in the history
* request example

* analytics

* quickstart

* memcache, redis

* mailjet, sendgrid

* static files

* cloud sql and postgresql and datastore

* Storage, twilio

* pubsub

* fix replace all errors
  • Loading branch information
averikitsch committed Aug 20, 2018
1 parent dfcb6a7 commit 2581b47
Show file tree
Hide file tree
Showing 42 changed files with 87 additions and 181 deletions.
6 changes: 2 additions & 4 deletions appengine/analytics/app.flexible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START app_yaml]
runtime: nodejs
env: flex

# [START env]
# [START gae_flex_analytics_env_variables]
env_variables:
GA_TRACKING_ID: YOUR_TRACKING_ID
# [END env]
# [END app_yaml]
# [END gae_flex_analytics_env_variables]
4 changes: 2 additions & 2 deletions appengine/analytics/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

'use strict';

// [START app]
// [START gae_flex_analytics_track_event]
const express = require('express');
const got = require('got');

Expand Down Expand Up @@ -69,4 +69,4 @@ app.listen(PORT, () => {
console.log(`App listening on port ${PORT}`);
console.log('Press Ctrl+C to quit.');
});
// [END app]
// [END gae_flex_analytics_track_event]
6 changes: 2 additions & 4 deletions appengine/analytics/app.standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START app_yaml]
runtime: nodejs8

# [START env]
# [START gae_analytics_env_variables]
env_variables:
GA_TRACKING_ID: YOUR_TRACKING_ID
# [END env]
# [END app_yaml]
# [END gae_analytics_env_variables]
8 changes: 2 additions & 6 deletions appengine/cloudsql/app.flexible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START app_yaml]
runtime: nodejs
env: flex

# [START env]
# [START gae_flex_mysql_env]
# The following env variables may contain sensitive information that grants
# anyone access to your database. Do not add this file to your source control.
env_variables:
Expand All @@ -24,13 +23,10 @@ env_variables:
SQL_DATABASE: YOUR_SQL_DATABASE
# e.g. my-awesome-project:us-central1:my-cloud-sql-instance
INSTANCE_CONNECTION_NAME: YOUR_INSTANCE_CONNECTION_NAME
# [END env]
# [END gae_flex_mysql_env]

# [START cloudsql_settings]
beta_settings:
# The connection name of your instance, available by using
# 'gcloud beta sql instances describe [INSTANCE_NAME]' or from
# the Instance details page in the Google Cloud Platform Console.
cloud_sql_instances: YOUR_INSTANCE_CONNECTION_NAME
# [END cloudsql_settings]
# [END app_yaml]
8 changes: 2 additions & 6 deletions appengine/cloudsql/app.standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START app_yaml]
runtime: nodejs8

# [START env]
# [START gae_mysql_env]
# The following env variables may contain sensitive information that grants
# anyone access to your database. Do not add this file to your source control.
env_variables:
Expand All @@ -23,13 +22,10 @@ env_variables:
SQL_DATABASE: YOUR_SQL_DATABASE
# e.g. my-awesome-project:us-central1:my-cloud-sql-instance
INSTANCE_CONNECTION_NAME: YOUR_INSTANCE_CONNECTION_NAME
# [END env]
# [END gae_mysql_env]

# [START cloudsql_settings]
beta_settings:
# The connection name of your instance, available by using
# 'gcloud beta sql instances describe [INSTANCE_NAME]' or from
# the Instance details page in the Google Cloud Platform Console.
cloud_sql_instances: YOUR_INSTANCE_CONNECTION_NAME
# [END cloudsql_settings]
# [END app_yaml]
4 changes: 2 additions & 2 deletions appengine/cloudsql/createTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

'use strict';

// [START createTables]
// [START gae_flex_mysql_create_tables]
const Knex = require('knex');
const prompt = require('prompt');

Expand Down Expand Up @@ -51,4 +51,4 @@ prompt.get(FIELDS, (err, config) => {
}
});
});
// [END createTables]
// [END gae_flex_mysql_create_tables]
8 changes: 4 additions & 4 deletions appengine/cloudsql/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// Require process, so we can mock environment variables
const process = require('process');

// [START app]
// [START gae_flex_mysql_app]
const express = require('express');
const Knex = require('knex');
const crypto = require('crypto');
Expand All @@ -29,7 +29,7 @@ app.enable('trust proxy');
const knex = connect();

function connect () {
// [START connect]
// [START gae_flex_mysql_connect]
const config = {
user: process.env.SQL_USER,
password: process.env.SQL_PASSWORD,
Expand All @@ -45,7 +45,7 @@ function connect () {
client: 'mysql',
connection: config
});
// [END connect]
// [END gae_flex_mysql_connect]

return knex;
}
Expand Down Expand Up @@ -105,6 +105,6 @@ app.listen(PORT, () => {
console.log(`App listening on port ${PORT}`);
console.log('Press Ctrl+C to quit.');
});
// [END app]
// [END gae_flex_mysql_app]

module.exports = app;
8 changes: 2 additions & 6 deletions appengine/cloudsql_postgresql/app.flexible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START app_yaml]
runtime: nodejs
env: flex

# [START env]
# [START gae_flex_postgres_env]
# The following env variables may contain sensitive information that grants
# anyone access to your database. Do not add this file to your source control.
env_variables:
Expand All @@ -24,13 +23,10 @@ env_variables:
SQL_DATABASE: YOUR_SQL_DATABASE
# e.g. my-awesome-project:us-central1:my-cloud-sql-instance
INSTANCE_CONNECTION_NAME: YOUR_INSTANCE_CONNECTION_NAME
# [END env]
# [END gae_flex_postgres_env]

# [START cloudsql_settings]
beta_settings:
# The connection name of your instance, available by using
# 'gcloud beta sql instances describe [INSTANCE_NAME]' or from
# the Instance details page in the Google Cloud Platform Console.
cloud_sql_instances: YOUR_INSTANCE_CONNECTION_NAME
# [END cloudsql_settings]
# [END app_yaml]
8 changes: 2 additions & 6 deletions appengine/cloudsql_postgresql/app.standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START app_yaml]
runtime: nodejs8

# [START env]
# [START gae_postgres_env]
# The following env variables may contain sensitive information that grants
# anyone access to your database. Do not add this file to your source control.
env_variables:
Expand All @@ -23,13 +22,10 @@ env_variables:
SQL_DATABASE: YOUR_SQL_DATABASE
# e.g. my-awesome-project:us-central1:my-cloud-sql-instance
INSTANCE_CONNECTION_NAME: YOUR_INSTANCE_CONNECTION_NAME
# [END env]
# [END gae_postgres_env]

# [START cloudsql_settings]
beta_settings:
# The connection name of your instance, available by using
# 'gcloud beta sql instances describe [INSTANCE_NAME]' or from
# the Instance details page in the Google Cloud Platform Console.
cloud_sql_instances: YOUR_INSTANCE_CONNECTION_NAME
# [END cloudsql_settings]
# [END app_yaml]
4 changes: 2 additions & 2 deletions appengine/cloudsql_postgresql/createTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

'use strict';

// [START createTables]
// [START gae_flex_postgres_create_tables]
const Knex = require('knex');
const prompt = require('prompt');

Expand Down Expand Up @@ -50,4 +50,4 @@ prompt.get(FIELDS, (err, config) => {
}
});
});
// [END createTables]
// [END gae_flex_postgres_create_tables]
8 changes: 4 additions & 4 deletions appengine/cloudsql_postgresql/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// Require process, so we can mock environment variables
const process = require('process');

// [START app]
// [START gae_flex_postgres_app]
const express = require('express');
const Knex = require('knex');
const crypto = require('crypto');
Expand All @@ -29,7 +29,7 @@ app.enable('trust proxy');
const knex = connect();

function connect () {
// [START connect]
// [START gae_flex_postgres_connect]
const config = {
user: process.env.SQL_USER,
password: process.env.SQL_PASSWORD,
Expand All @@ -45,7 +45,7 @@ function connect () {
client: 'pg',
connection: config
});
// [END connect]
// [END gae_flex_postgres_connect]

return knex;
}
Expand Down Expand Up @@ -105,6 +105,6 @@ app.listen(PORT, () => {
console.log(`App listening on port ${PORT}`);
console.log('Press Ctrl+C to quit.');
});
// [END app]
// [END gae_flex_postgres_app]

module.exports = app;
2 changes: 0 additions & 2 deletions appengine/datastore/app.flexible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START app_yaml]
runtime: nodejs
env: flex
# [END app_yaml]
12 changes: 2 additions & 10 deletions appengine/datastore/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
* limitations under the License.
*/

// [START app]
// [START gae_flex_datastore_app]
'use strict';

// [START setup]
const express = require('express');
const crypto = require('crypto');

Expand All @@ -32,9 +31,7 @@ const Datastore = require('@google-cloud/datastore');

// Instantiate a datastore client
const datastore = Datastore();
// [END setup]

// [START insertVisit]
/**
* Insert a visit record into the database.
*
Expand All @@ -46,9 +43,7 @@ function insertVisit (visit) {
data: visit
});
}
// [END insertVisit]

// [START getVisits]
/**
* Retrieve the latest 10 visit records from the database.
*/
Expand All @@ -63,7 +58,6 @@ function getVisits () {
return entities.map((entity) => `Time: ${entity.timestamp}, AddrHash: ${entity.userIp}`);
});
}
// [END getVisits]

app.get('/', (req, res, next) => {
// Create a visit record to be stored in the database
Expand All @@ -86,13 +80,11 @@ app.get('/', (req, res, next) => {
.catch(next);
});

// [START listen]
const PORT = process.env.PORT || 8080;
app.listen(process.env.PORT || 8080, () => {
console.log(`App listening on port ${PORT}`);
console.log('Press Ctrl+C to quit.');
});
// [END listen]
// [END app]
// [END gae_flex_datastore_app]

module.exports = app;
2 changes: 0 additions & 2 deletions appengine/datastore/app.standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START app_yaml]
runtime: nodejs8
# [END app_yaml]
4 changes: 2 additions & 2 deletions appengine/hello-world/flexible/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

'use strict';

// [START app]
// [START gae_flex_quickstart]
const express = require('express');

const app = express();
Expand All @@ -30,4 +30,4 @@ app.listen(PORT, () => {
console.log(`App listening on port ${PORT}`);
console.log('Press Ctrl+C to quit.');
});
// [END app]
// [END gae_flex_quickstart]
6 changes: 3 additions & 3 deletions appengine/hello-world/flexible/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START app_yaml]
# [START gae_flex_quickstart_yaml]
runtime: nodejs
env: flex

# This sample incurs costs to run on the App Engine flexible environment.
# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml
Expand All @@ -26,4 +26,4 @@ resources:
memory_gb: 0.5
disk_size_gb: 10

# [END app_yaml]
# [END gae_flex_quickstart_yaml]
4 changes: 2 additions & 2 deletions appengine/hello-world/standard/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

'use strict';

// [START app]
// [START gae_node_request_example]
const express = require('express');

const app = express();
Expand All @@ -30,4 +30,4 @@ app.listen(PORT, () => {
console.log(`App listening on port ${PORT}`);
console.log('Press Ctrl+C to quit.');
});
// [END app]
// [END gae_node_request_example]
4 changes: 2 additions & 2 deletions appengine/mailjet/app.flexible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START app_yaml]
# [START gae_flex_mailjet_yaml]
runtime: nodejs
env: flex

Expand All @@ -21,4 +21,4 @@ env: flex
env_variables:
MJ_APIKEY_PUBLIC: <your-mj-apikey-public>
MJ_APIKEY_PRIVATE: <your-mj-apikey-private>
# [END app_yaml]
# [END gae_flex_mailjet_yaml]
Loading

0 comments on commit 2581b47

Please sign in to comment.