Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Firebase function serving restify server if production(else just start server onj)
const server = require(`./src/server`);
process.env.NODE_ENV === "DEV" ?
/**
* If dev environment, run express server for local debugging.
*/
server.listen(process.env.PORT || 3000) :
/**
* Creates a function instance and with a specific specs.
* Serve to FireBase Express server obj.
*/
exports[require("./package").name] = require("firebase-functions")
.region("europe-west1")
.runWith({ timeoutSeconds: 300, memory: "2GB" }).https.onRequest(server);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment