How to host nodeJS project to firebase?

﹥>﹥吖頭↗ 提交于 2019-12-02 22:30:15

You're in luck. Firebase just this week released a video that walks step-by-step through setting up an Node.js/Express app on Firebase Hosting.

This has only been possible since the integration of Cloud Functions with Firebase Hosting, which was released at I/O 2017. Most tutorials likely are from before that time, when there was no way to run server-side code on Firebase Hosting.

You can do this by firebase cloud function. Deployment auth is handled by the Firebase CLI, so getting a hello world up and running is literally:

firebase init functions
firebase deploy

A simple hello world function

functions.https.onRequest((request, response) => {
    response.send(“Hello from Firebase!”);
});

Note: You can use express with firebase function.

For more follow documentation link: https://firebase.google.com/docs/functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!