Skip to content

Instantly share code, notes, and snippets.

@williamchong
Created September 24, 2020 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save williamchong/8c82829084f5090210b5ca22671a5e3b to your computer and use it in GitHub Desktop.
Save williamchong/8c82829084f5090210b5ca22671a5e3b to your computer and use it in GitHub Desktop.
nuxt + express production server
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