Last active
May 13, 2019 09:53
-
-
Save evilUrge/8953f23ead66358c21290c3c471fb410 to your computer and use it in GitHub Desktop.
Firebase function serving restify server if production(else just start server onj)
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
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