Skip to content

Commit f2b05b1

Browse files
author
Ace Nassri
authored
Minor lint fixes for GAE samples (#1342)
1 parent 4a7e93b commit f2b05b1

File tree

10 files changed

+15
-15
lines changed

10 files changed

+15
-15
lines changed

appengine/analytics/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ app.enable('trust proxy');
2424

2525
// The following environment variable is set by app.yaml when running on App
2626
// Engine, but will need to be set manually when running locally. See README.md.
27-
const GA_TRACKING_ID = process.env.GA_TRACKING_ID;
27+
const {GA_TRACKING_ID} = process.env;
2828

2929
function trackEvent(category, action, label, value) {
3030
const data = {

appengine/endpoints/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
const express = require('express');
1919
const bodyParser = require('body-parser');
20-
const Buffer = require('safe-buffer').Buffer;
20+
const {Buffer} = require('safe-buffer');
2121

2222
const app = express();
2323
app.use(bodyParser.json());

appengine/endpoints/test/app.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
'use strict';
1717

18-
const Buffer = require('safe-buffer').Buffer;
18+
const {Buffer} = require('safe-buffer');
1919
const express = require('express');
2020
const path = require('path');
2121
const proxyquire = require('proxyquire').noCallThru();

appengine/headless-chrome/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const app = express();
2323
let browser;
2424

2525
app.use(async (req, res) => {
26-
const url = req.query.url;
26+
const {url} = req.query;
2727

2828
if (!url) {
2929
return res.send(
@@ -51,7 +51,7 @@ const server = app.listen(process.env.PORT || 8080, err => {
5151
if (err) {
5252
return console.error(err);
5353
}
54-
const port = server.address().port;
54+
const {port} = server.address();
5555
console.info(`App listening on port ${port}`);
5656
});
5757
// [END full_sample]

appengine/memcached/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const app = express();
2222

2323
// [START gae_flex_redislabs_memcache]
2424
// Environment variables are defined in app.yaml.
25-
const MEMCACHE_URL = process.env.MEMCACHE_URL;
25+
const {MEMCACHE_URL} = process.env;
2626

2727
const mc = memjs.Client.create(MEMCACHE_URL);
2828
// [END gae_flex_redislabs_memcache]

appengine/pubsub/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const express = require('express');
1919
const bodyParser = require('body-parser');
2020
const {OAuth2Client} = require('google-auth-library');
2121
const path = require('path');
22-
const Buffer = require('safe-buffer').Buffer;
22+
const {Buffer} = require('safe-buffer');
2323
const process = require('process'); // Required for mocking environment variables
2424

2525
// By default, the client will authenticate using the service account file
@@ -47,7 +47,7 @@ const tokens = [];
4747

4848
// The following environment variables are set by app.yaml when running on GAE,
4949
// but will need to be manually set when running locally.
50-
const PUBSUB_VERIFICATION_TOKEN = process.env.PUBSUB_VERIFICATION_TOKEN;
50+
const {PUBSUB_VERIFICATION_TOKEN} = process.env;
5151
const TOPIC = process.env.PUBSUB_TOPIC;
5252

5353
const topic = pubsub.topic(TOPIC);

appengine/sendgrid/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const bodyParser = require('body-parser');
2323
// The following environment variables are set by app.yaml (app.flexible.yaml or
2424
// app.standard.yaml) when running on Google App Engine,
2525
// but will need to be manually set when running locally.
26-
const SENDGRID_API_KEY = process.env.SENDGRID_API_KEY;
27-
const SENDGRID_SENDER = process.env.SENDGRID_SENDER;
26+
const {SENDGRID_API_KEY} = process.env;
27+
const {SENDGRID_SENDER} = process.env;
2828
const Sendgrid = require('@sendgrid/client');
2929

3030
Sendgrid.setApiKey(SENDGRID_API_KEY);

appengine/storage/flexible/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
const process = require('process'); // Required to mock environment variables
1919

2020
// [START gae_flex_storage_app]
21-
const format = require('util').format;
21+
const {format} = require('util');
2222
const express = require('express');
2323
const Multer = require('multer');
2424
const bodyParser = require('body-parser');

appengine/storage/standard/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
const process = require('process'); // Required to mock environment variables
1919

2020
// [START gae_storage_app]
21-
const format = require('util').format;
21+
const {format} = require('util');
2222
const express = require('express');
2323
const Multer = require('multer');
2424
const bodyParser = require('body-parser');

appengine/twilio/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const bodyParser = require('body-parser').urlencoded({
2222

2323
const app = express();
2424

25-
const TWILIO_NUMBER = process.env.TWILIO_NUMBER;
25+
const {TWILIO_NUMBER} = process.env;
2626
if (!TWILIO_NUMBER) {
2727
console.log(
2828
'Please configure environment variables as described in README.md'
@@ -39,7 +39,7 @@ const twilioClient = Twilio(
3939
process.env.TWILIO_AUTH_TOKEN
4040
);
4141

42-
const TwimlResponse = Twilio.TwimlResponse;
42+
const {TwimlResponse} = Twilio;
4343

4444
// [START gae_flex_twilio_receive_call]
4545
app.post('/call/receive', (req, res) => {
@@ -55,7 +55,7 @@ app.post('/call/receive', (req, res) => {
5555

5656
// [START gae_flex_twilio_send_sms]
5757
app.get('/sms/send', async (req, res, next) => {
58-
const to = req.query.to;
58+
const {to} = req.query;
5959
if (!to) {
6060
res
6161
.status(400)

0 commit comments

Comments
 (0)