ios. firebase
nuxt-ssr-firebase (nuxt-ssr-firebase)
Nuxt.js Universal App with SSR via Firebase Functions and Firebase Hosting
通过Firebase功能和Firebase托管具有SSR的Nuxt.js通用应用程序
Host a Nuxt Universal app or site by combining Nuxt.js with Firebase Cloud Functions and Hosting.
通过将Nuxt.js与Firebase Cloud Functions和Hosting相结合来托管Nuxt Universal应用或网站。
预设置:安装任何依赖项之前 (Pre-Setup: Before Installing Any Dependencies)
-
Obtain a Firebase Project ID to use for this project. See Overiew Here
获取要用于此项目的Firebase项目ID。 在这里看到Overiew
-
Inside this directory, locate the file
.setup-firebaserc
and replace the textyour-project-id
with your Firebase Project ID.在此目录中,找到文件
.setup-firebaserc
并将文本your-project-id
替换为Firebase Project ID。
建立 (Setup)
We will now get everything setup and deployed in 3 commands:
现在,我们将通过3个命令来设置和部署所有内容:
Note: All of these commands are ran from the root directory
注意: 所有这些命令都是从根目录运行的
Install Dependencies in all necessary directories and creates
.firebaserc
from from.setup-firebaserc
by using apostinstall hook
在所有必要目录中安装依赖项,并使用
postinstall hook
从.setup-firebaserc
创建.firebaserc
yarn
Build The Project
建立项目
yarn build
Deploy To Firebase
部署到Firebase
yarn deploy
Your site should now be live!
您的网站现在应该可以使用了!
Firebase项目设置 (Firebase Project Setup)
-
Create a Firebase Project using the Firebase Console.
使用Firebase控制台创建Firebase项目。
-
Obtain the Firebase Project ID
获取Firebase项目ID
特征 (Features)
Server-side rendering with Firebase Hosting combined with Firebase Functions
将Firebase托管与Firebase功能结合使用的服务器端渲染
Firebase Hosting as our CDN for our publicPath (See nuxt.config.js)
Firebase托管作为我们publicPath的CDN(请参阅nuxt.config.js)
要知道的事... (Things to know...)
-
You must have the Firebase CLI installed. If you don't have it install it with
npm install -g firebase-tools
and then configure it withfirebase login
.您必须安装Firebase CLI。 如果没有,请使用
npm install -g firebase-tools
,然后使用firebase login
进行配置。 -
If you have errors, make sure
firebase-tools
is up to date. I've experienced many problems that were resolved once I updated.如果有错误,请确保
firebase-tools
是最新的。 更新后,我遇到了许多已解决的问题。 -
The root directory has a package.json file with several scripts that will be used to optimize and ease getting started and the workflow
根目录包含一个package.json文件,其中包含多个脚本,这些脚本将用于优化和简化入门以及工作流程
-
ALL commands are ran from the root directory
所有命令均从根目录运行
ios. firebase