-
-
Save williamchong/8c82829084f5090210b5ca22671a5e3b to your computer and use it in GitHub Desktop.
nuxt + express production server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { config, https } from 'firebase-functions'; | |
import express from 'express'; | |
import helmet from 'helmet'; | |
import api from './api'; | |
const app = express(); | |
app.use(helmet()); | |
app.set('trust proxy', 1); | |
app.use('/api', api); | |
if ((config().constant || {}).external_url) { | |
process.env.API_URL = config().constant.external_url; | |
} | |
const internalHttp = https.onRequest(app); | |
module.exports = internalHttp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment