如何将nodeJS项目托管到Firebase? [英] How to host nodeJS project to firebase?

查看:111
本文介绍了如何将nodeJS项目托管到Firebase?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为项目使用节点,表达和更多其他依赖项.我想知道如何在Firebase上托管此项目.我的项目将具有controller,view和其他任何文件夹,以使该项目成为可能.它已经具有诸如pug/handlebars的视图引擎.

I am using node, express and more other dependencies for the project. I wonder how to host this project on firebase. My project will have controller, view , and any other folders to make the project possible.It already has view engine like pug/handlebars.

在线教程仅显示如何使用公用文件夹中的单个index.html托管Firebase.我应该如何将我的项目与所有其他文件夹一起托管?我知道如何在nodeJS中使用firebase,但是如何在firebase上托管项目? firebase将如何访问服务器文件(app/index.js)?我应该把所有这些文件夹放在哪里?

Tutorials online only show how to host firebase with single index.html in public folder. How am I suppose to host my project with all other folders? I know how to use firebase in nodeJS, but how to host the project on firebase? How firebase will access the server file(either app/index.js)? Where should I put all these folders?

希望我没有要求太多.如果我的问题不清楚,请告诉我,以便我进行澄清.

Hopefully I am not asking to much. If my question isn't clear, please let me know so that I can make clarification.

推荐答案

您很幸运. Firebase刚刚在本周发布了视频,逐步介绍了如何设置Node.js/Express Firebase Hosting上的应用程序.

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.

只有在I/O 2017上发布了Cloud Functions与Firebase Hosting的集成之后才有可能.大多数教程可能是在那之前的,当时无法在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.

这篇关于如何将nodeJS项目托管到Firebase?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆