Skip to content

Commit

Permalink
Minor lint fixes for GAE samples (#1342)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ace Nassri authored Jun 5, 2019
1 parent 4a7e93b commit f2b05b1
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion appengine/analytics/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ app.enable('trust proxy');

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

function trackEvent(category, action, label, value) {
const data = {
Expand Down
2 changes: 1 addition & 1 deletion appengine/endpoints/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

const express = require('express');
const bodyParser = require('body-parser');
const Buffer = require('safe-buffer').Buffer;
const {Buffer} = require('safe-buffer');

const app = express();
app.use(bodyParser.json());
Expand Down
2 changes: 1 addition & 1 deletion appengine/endpoints/test/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

'use strict';

const Buffer = require('safe-buffer').Buffer;
const {Buffer} = require('safe-buffer');
const express = require('express');
const path = require('path');
const proxyquire = require('proxyquire').noCallThru();
Expand Down
4 changes: 2 additions & 2 deletions appengine/headless-chrome/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const app = express();
let browser;

app.use(async (req, res) => {
const url = req.query.url;
const {url} = req.query;

if (!url) {
return res.send(
Expand Down Expand Up @@ -51,7 +51,7 @@ const server = app.listen(process.env.PORT || 8080, err => {
if (err) {
return console.error(err);
}
const port = server.address().port;
const {port} = server.address();
console.info(`App listening on port ${port}`);
});
// [END full_sample]
Expand Down
2 changes: 1 addition & 1 deletion appengine/memcached/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const app = express();

// [START gae_flex_redislabs_memcache]
// Environment variables are defined in app.yaml.
const MEMCACHE_URL = process.env.MEMCACHE_URL;
const {MEMCACHE_URL} = process.env;

const mc = memjs.Client.create(MEMCACHE_URL);
// [END gae_flex_redislabs_memcache]
Expand Down
4 changes: 2 additions & 2 deletions appengine/pubsub/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const express = require('express');
const bodyParser = require('body-parser');
const {OAuth2Client} = require('google-auth-library');
const path = require('path');
const Buffer = require('safe-buffer').Buffer;
const {Buffer} = require('safe-buffer');
const process = require('process'); // Required for mocking environment variables

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

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

const topic = pubsub.topic(TOPIC);
Expand Down
4 changes: 2 additions & 2 deletions appengine/sendgrid/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const bodyParser = require('body-parser');
// The following environment variables are set by app.yaml (app.flexible.yaml or
// app.standard.yaml) when running on Google App Engine,
// but will need to be manually set when running locally.
const SENDGRID_API_KEY = process.env.SENDGRID_API_KEY;
const SENDGRID_SENDER = process.env.SENDGRID_SENDER;
const {SENDGRID_API_KEY} = process.env;
const {SENDGRID_SENDER} = process.env;
const Sendgrid = require('@sendgrid/client');

Sendgrid.setApiKey(SENDGRID_API_KEY);
Expand Down
2 changes: 1 addition & 1 deletion appengine/storage/flexible/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
const process = require('process'); // Required to mock environment variables

// [START gae_flex_storage_app]
const format = require('util').format;
const {format} = require('util');
const express = require('express');
const Multer = require('multer');
const bodyParser = require('body-parser');
Expand Down
2 changes: 1 addition & 1 deletion appengine/storage/standard/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
const process = require('process'); // Required to mock environment variables

// [START gae_storage_app]
const format = require('util').format;
const {format} = require('util');
const express = require('express');
const Multer = require('multer');
const bodyParser = require('body-parser');
Expand Down
6 changes: 3 additions & 3 deletions appengine/twilio/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const bodyParser = require('body-parser').urlencoded({

const app = express();

const TWILIO_NUMBER = process.env.TWILIO_NUMBER;
const {TWILIO_NUMBER} = process.env;
if (!TWILIO_NUMBER) {
console.log(
'Please configure environment variables as described in README.md'
Expand All @@ -39,7 +39,7 @@ const twilioClient = Twilio(
process.env.TWILIO_AUTH_TOKEN
);

const TwimlResponse = Twilio.TwimlResponse;
const {TwimlResponse} = Twilio;

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

// [START gae_flex_twilio_send_sms]
app.get('/sms/send', async (req, res, next) => {
const to = req.query.to;
const {to} = req.query;
if (!to) {
res
.status(400)
Expand Down

0 comments on commit f2b05b1

Please sign in to comment.