Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
refactor: rename Express instance from app to server
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavopch committed Oct 2, 2020
1 parent 6e4bdc2 commit eed759b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/functions/https/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -107,5 +107,5 @@ export const createCommandsEndpoint = (
}
})

return functions.https.onRequest(app)
return functions.https.onRequest(server)
}

0 comments on commit eed759b

Please sign in to comment.