From eed759bdccde06741abdec4a7a70450b7e3bced8 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Fri, 2 Oct 2020 15:42:48 -0300 Subject: [PATCH] refactor: rename Express instance from app to server --- src/functions/https/commands.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/functions/https/commands.ts b/src/functions/https/commands.ts index 2130c35..b42db37 100644 --- a/src/functions/https/commands.ts +++ b/src/functions/https/commands.ts @@ -47,12 +47,12 @@ export const createCommandsEndpoint = ( ): functions.HttpsFunction => { const application = createApplication(firebaseApp, applicationDefinition) - const app = express() - app.set('trust proxy', true) - app.use(cors({ origin: true })) - app.use(validateFirebaseIdToken(firebaseApp)) + const server = express() + server.set('trust proxy', true) + server.use(cors({ origin: true })) + server.use(validateFirebaseIdToken(firebaseApp)) - app.post('/', async (req, res) => { + server.post('/', async (req, res) => { try { const isCommandValid = await validateCommand(req.body) @@ -107,5 +107,5 @@ export const createCommandsEndpoint = ( } }) - return functions.https.onRequest(app) + return functions.https.onRequest(server) }