GeezerVison is showing github.com — Merge pull request #39 from GoogleCloudPlatform/config · stackriot/nodejs-docs-samples@2b9ea17
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: 2-structured-data/config.js +5-6Lines changed: 5 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 13 | 13 |
| 14 | 14 | 'use strict'; | 15 | 15 |
| 16 | | - | 17 | 16 | module.exports = { | 18 | 17 | port: process.env.PORT || 8080, | 19 | 18 |
| @@ -29,13 +28,13 @@ module.exports = { | 29 | 28 | }, | 30 | 29 |
| 31 | 30 | mysql: { | 32 | | - user: 'your-mysql-user', | 33 | | - password: 'your-mysql-password', | 34 | | - host: 'your-mysql-host' | | 31 | + user: process.env.MYSQL_USER || 'your-mysql-user', | | 32 | + password: process.env.MYSQL_PASSWORD || 'your-mysql-password', | | 33 | + host: process.env.MYSQL_HOST || 'your-mysql-host' | 35 | 34 | }, | 36 | 35 |
| 37 | 36 | mongodb: { | 38 | | - url: 'your-mongo-url', | 39 | | - collection: 'your-mongo-collection' | | 37 | + url: process.env.MONGO_URL || 'mongodb://localhost:27017', | | 38 | + collection: process.env.MONGO_COLLECTION || 'books' | 40 | 39 | } | 41 | 40 | }; |
Collapse file Copy file name to clipboardExpand all lines: 3-binary-data/config.js +6-6Lines changed: 6 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -29,16 +29,16 @@ module.exports = { | 29 | 29 | }, | 30 | 30 |
| 31 | 31 | // Typically, you will create a bucket with the same name as your project ID. | 32 | | - cloudStorageBucket: 'your-bucket-name', | | 32 | + cloudStorageBucket: process.env.CLOUD_BUCKET || 'your-bucket-name', | 33 | 33 |
| 34 | 34 | mysql: { | 35 | | - user: 'your-mysql-user', | 36 | | - password: 'your-mysql-password', | 37 | | - host: 'your-mysql-host' | | 35 | + user: process.env.MYSQL_USER || 'your-mysql-user', | | 36 | + password: process.env.MYSQL_PASSWORD || 'your-mysql-password', | | 37 | + host: process.env.MYSQL_HOST || 'your-mysql-host' | 38 | 38 | }, | 39 | 39 |
| 40 | 40 | mongodb: { | 41 | | - url: 'your-mongo-url', | 42 | | - collection: 'your-mongo-collection' | | 41 | + url: process.env.MONGO_URL || 'mongodb://localhost:27017', | | 42 | + collection: process.env.MONGO_COLLECTION || 'books' | 43 | 43 | } | 44 | 44 | }; |
Collapse file Copy file name to clipboardExpand all lines: 4-auth/config.js +10-10Lines changed: 10 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -18,7 +18,7 @@ module.exports = { | 18 | 18 | port: process.env.PORT || 8080, | 19 | 19 |
| 20 | 20 | // Secret is used by sessions to encrypt the cookie. | 21 | | - secret: 'your-secret-here', | | 21 | + secret: process.env.SESSION_SECRET || 'your-secret-here', | 22 | 22 |
| 23 | 23 | // dataBackend can be 'datastore', 'cloudsql', or 'mongodb'. Be sure to | 24 | 24 | // configure the appropriate settings for each storage engine below. | @@ -32,26 +32,26 @@ module.exports = { | 32 | 32 | }, | 33 | 33 |
| 34 | 34 | // Typically, you will create a bucket with the same name as your project ID. | 35 | | - cloudStorageBucket: 'your-bucket-name', | | 35 | + cloudStorageBucket: process.env.CLOUD_BUCKET || 'your-bucket-name', | 36 | 36 |
| 37 | 37 | mysql: { | 38 | | - user: 'your-mysql-user', | 39 | | - password: 'your-mysql-password', | 40 | | - host: 'your-mysql-host' | | 38 | + user: process.env.MYSQL_USER || 'your-mysql-user', | | 39 | + password: process.env.MYSQL_PASSWORD || 'your-mysql-password', | | 40 | + host: process.env.MYSQL_HOST || 'your-mysql-host' | 41 | 41 | }, | 42 | 42 |
| 43 | 43 | mongodb: { | 44 | | - url: 'your-mongo-url', | 45 | | - collection: 'your-mongo-collection' | | 44 | + url: process.env.MONGO_URL || 'mongodb://localhost:27017', | | 45 | + collection: process.env.MONGO_COLLECTION || 'books' | 46 | 46 | }, | 47 | 47 |
| 48 | 48 | // The client ID and secret can be obtained by generating a new web | 49 | 49 | // application client ID on Google Developers Console. | 50 | 50 | oauth2: { | 51 | | - clientId: 'your-client-id', | 52 | | - clientSecret: 'your-client-secret', | | 51 | + clientId: process.env.OAUTH_CLIENT_ID || 'your-client-id', | | 52 | + clientSecret: process.env.OAUTH_CLIENT_SECRET || 'your-client-secret', | 53 | 53 | redirectUrl: process.env.OAUTH2_CALLBACK || | 54 | 54 | 'http://localhost:8080/oauth2callback', | 55 | 55 | scopes: ['email', 'profile'] | 56 | | - }, | | 56 | + } | 57 | 57 | }; |
Collapse file Copy file name to clipboardExpand all lines: 5-logging/config.js +10-10Lines changed: 10 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -18,7 +18,7 @@ module.exports = { | 18 | 18 | port: process.env.PORT || 8080, | 19 | 19 |
| 20 | 20 | // Secret is used by sessions to encrypt the cookie. | 21 | | - secret: 'your-secret-here', | | 21 | + secret: process.env.SESSION_SECRET || 'your-secret-here', | 22 | 22 |
| 23 | 23 | // dataBackend can be 'datastore', 'cloudsql', or 'mongodb'. Be sure to | 24 | 24 | // configure the appropriate settings for each storage engine below. | @@ -32,26 +32,26 @@ module.exports = { | 32 | 32 | }, | 33 | 33 |
| 34 | 34 | // Typically, you will create a bucket with the same name as your project ID. | 35 | | - cloudStorageBucket: 'your-bucket-name', | | 35 | + cloudStorageBucket: process.env.CLOUD_BUCKET || 'your-bucket-name', | 36 | 36 |
| 37 | 37 | mysql: { | 38 | | - user: 'your-mysql-user', | 39 | | - password: 'your-mysql-password', | 40 | | - host: 'your-mysql-host' | | 38 | + user: process.env.MYSQL_USER || 'your-mysql-user', | | 39 | + password: process.env.MYSQL_PASSWORD || 'your-mysql-password', | | 40 | + host: process.env.MYSQL_HOST || 'your-mysql-host' | 41 | 41 | }, | 42 | 42 |
| 43 | 43 | mongodb: { | 44 | | - url: 'your-mongo-url', | 45 | | - collection: 'your-mongo-collection' | | 44 | + url: process.env.MONGO_URL || 'mongodb://localhost:27017', | | 45 | + collection: process.env.MONGO_COLLECTION || 'books' | 46 | 46 | }, | 47 | 47 |
| 48 | 48 | // The client ID and secret can be obtained by generating a new web | 49 | 49 | // application client ID on Google Developers Console. | 50 | 50 | oauth2: { | 51 | | - clientId: 'your-client-id', | 52 | | - clientSecret: 'your-client-secret', | | 51 | + clientId: process.env.OAUTH_CLIENT_ID || 'your-client-id', | | 52 | + clientSecret: process.env.OAUTH_CLIENT_SECRET || 'your-client-secret', | 53 | 53 | redirectUrl: process.env.OAUTH2_CALLBACK || | 54 | 54 | 'http://localhost:8080/oauth2callback', | 55 | 55 | scopes: ['email', 'profile'] | 56 | | - }, | | 56 | + } | 57 | 57 | }; |
Collapse file Copy file name to clipboardExpand all lines: 6-pubsub/config.js +10-10Lines changed: 10 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -18,7 +18,7 @@ module.exports = { | 18 | 18 | port: process.env.PORT || 8080, | 19 | 19 |
| 20 | 20 | // Secret is used by sessions to encrypt the cookie. | 21 | | - secret: 'your-secret-here', | | 21 | + secret: process.env.SESSION_SECRET || 'your-secret-here', | 22 | 22 |
| 23 | 23 | // dataBackend can be 'datastore', 'cloudsql', or 'mongodb'. Be sure to | 24 | 24 | // configure the appropriate settings for each storage engine below. | @@ -32,26 +32,26 @@ module.exports = { | 32 | 32 | }, | 33 | 33 |
| 34 | 34 | // Typically, you will create a bucket with the same name as your project ID. | 35 | | - cloudStorageBucket: 'your-bucket-name', | | 35 | + cloudStorageBucket: process.env.CLOUD_BUCKET || 'your-bucket-name', | 36 | 36 |
| 37 | 37 | mysql: { | 38 | | - user: 'your-mysql-user', | 39 | | - password: 'your-mysql-password', | 40 | | - host: 'your-mysql-host' | | 38 | + user: process.env.MYSQL_USER || 'your-mysql-user', | | 39 | + password: process.env.MYSQL_PASSWORD || 'your-mysql-password', | | 40 | + host: process.env.MYSQL_HOST || 'your-mysql-host' | 41 | 41 | }, | 42 | 42 |
| 43 | 43 | mongodb: { | 44 | | - url: 'your-mongo-url', | 45 | | - collection: 'your-mongo-collection' | | 44 | + url: process.env.MONGO_URL || 'mongodb://localhost:27017', | | 45 | + collection: process.env.MONGO_COLLECTION || 'books' | 46 | 46 | }, | 47 | 47 |
| 48 | 48 | // The client ID and secret can be obtained by generating a new web | 49 | 49 | // application client ID on Google Developers Console. | 50 | 50 | oauth2: { | 51 | | - clientId: 'your-client-id', | 52 | | - clientSecret: 'your-client-secret', | | 51 | + clientId: process.env.OAUTH_CLIENT_ID || 'your-client-id', | | 52 | + clientSecret: process.env.OAUTH_CLIENT_SECRET || 'your-client-secret', | 53 | 53 | redirectUrl: process.env.OAUTH2_CALLBACK || | 54 | 54 | 'http://localhost:8080/oauth2callback', | 55 | 55 | scopes: ['email', 'profile'] | 56 | | - }, | | 56 | + } | 57 | 57 | }; |
Collapse file Copy file name to clipboardExpand all lines: 7-gce/config.js +10-10Lines changed: 10 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -18,7 +18,7 @@ module.exports = { | 18 | 18 | port: process.env.PORT || 8080, | 19 | 19 |
| 20 | 20 | // Secret is used by sessions to encrypt the cookie. | 21 | | - secret: 'your-secret-here', | | 21 | + secret: process.env.SESSION_SECRET || 'your-secret-here', | 22 | 22 |
| 23 | 23 | // dataBackend can be 'datastore', 'cloudsql', or 'mongodb'. Be sure to | 24 | 24 | // configure the appropriate settings for each storage engine below. | @@ -32,26 +32,26 @@ module.exports = { | 32 | 32 | }, | 33 | 33 |
| 34 | 34 | // Typically, you will create a bucket with the same name as your project ID. | 35 | | - cloudStorageBucket: 'your-bucket-name', | | 35 | + cloudStorageBucket: process.env.CLOUD_BUCKET || 'your-bucket-name', | 36 | 36 |
| 37 | 37 | mysql: { | 38 | | - user: 'your-mysql-user', | 39 | | - password: 'your-mysql-password', | 40 | | - host: 'your-mysql-host' | | 38 | + user: process.env.MYSQL_USER || 'your-mysql-user', | | 39 | + password: process.env.MYSQL_PASSWORD || 'your-mysql-password', | | 40 | + host: process.env.MYSQL_HOST || 'your-mysql-host' | 41 | 41 | }, | 42 | 42 |
| 43 | 43 | mongodb: { | 44 | | - url: 'your-mongo-url', | 45 | | - collection: 'your-mongo-collection' | | 44 | + url: process.env.MONGO_URL || 'mongodb://localhost:27017', | | 45 | + collection: process.env.MONGO_COLLECTION || 'books' | 46 | 46 | }, | 47 | 47 |
| 48 | 48 | // The client ID and secret can be obtained by generating a new web | 49 | 49 | // application client ID on Google Developers Console. | 50 | 50 | oauth2: { | 51 | | - clientId: 'your-client-id', | 52 | | - clientSecret: 'your-client-secret', | | 51 | + clientId: process.env.OAUTH_CLIENT_ID || 'your-client-id', | | 52 | + clientSecret: process.env.OAUTH_CLIENT_SECRET || 'your-client-secret', | 53 | 53 | redirectUrl: process.env.OAUTH2_CALLBACK || | 54 | 54 | 'http://localhost:8080/oauth2callback', | 55 | 55 | scopes: ['email', 'profile'] | 56 | | - }, | | 56 | + } | 57 | 57 | }; |
|