ios. firebase_通过Firebase功能和Firebase托管具有SSR的Nuxt.js通用应用程序

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)

  1. Obtain a Firebase Project ID to use for this project. See Overiew Here

    获取要用于此项目的Firebase项目ID。 在这里看到Overiew

  2. Inside this directory, locate the file .setup-firebaserc and replace the text your-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

注意: 所有这些命令都是从根目录运行的

  1. Install Dependencies in all necessary directories and creates .firebaserc from from .setup-firebaserc by using a postinstall hook

    在所有必要目录中安装依赖项,并使用postinstall hook.setup-firebaserc创建.firebaserc

yarn
  1. Build The Project

    建立项目

yarn build
  1. Deploy To Firebase

    部署到Firebase

yarn deploy

Your site should now be live!

您的网站现在应该可以使用了!



Firebase项目设置 (Firebase Project Setup)

  1. Create a Firebase Project using the Firebase Console.

    使用Firebase控制台创建Firebase项目。

  2. 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 with firebase 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

    所有命令均从根目录运行

翻译自: https://vuejsexamples.com/nuxt-js-universal-app-with-ssr-via-firebase-functions-and-firebase-hosting/

ios. firebase

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值