如何将我的divshot静态网站迁移到firebase?

时间:2015-12-11 03:03:13

标签: firebase firebase-hosting divshot

每次通过Google / Firebase.io收购Divshot.io,我都需要迁移我的作品"静态" 2015年12月22日之前的HTML应用程序。我已安装最新的firebase-tools CLI并更新到最新的divshot CLI,并以其他方式准备好我的环境。

我已遵循divshot的所有指导,但在尝试deploy时收到以下错误:

Jeffs-rMBP:insider-web jeff [develop] $ cp -p divshot.production.json divshot.json
Jeffs-rMBP:insider-web jeff [develop] $ divshot migrate

Migrating Divshot app insider-web to Firebase Hosting

What is your Firebase project's name? (insider-web) insider
Can we anonymously report which features your app used (for Firebase Hosting roadmap planning, etc.)? (y/n) y
Write firebase.json? (y/n) y

⚠ Warning: The following incompatible features were detected.
- clean_urls support is planned for Firebase Hosting, but is not yet available
- Firebase Hosting does not support AJAX proxying

  Don't panic! Some features may be coming soon or there may be workarounds.
  Contact support@firebase.com with any questions.

You need to take the following actions to fully migrate your app:
- Rename error.html to 404.html

Wrote firebase.json configuration file.

If you have the latest version of firebase-tools you should now be able
to run firebase serve in this directory to start a local server and
firebase deploy to deploy to Firebase Hosting.

See http://docs.divshot.com/migrate for additional migration info.

Jeffs-rMBP:insider-web jeff [develop] $ 

我按照每次重命名error.html404.html的指导:

Jeffs-rMBP:insider-web jeff [develop] $ cp -p error.html 404.html
Jeffs-rMBP:insider-web jeff [develop] $ 

到目前为止看起来很好,但在尝试部署之后,我收到了这条消息:

Jeffs-rMBP:insider-web jeff [develop] $ firebase deploy

Error: Authentication required.
Jeffs-rMBP:insider-web jeff [develop] $ 

这是我原来的divshot.json文件:

Jeffs-rMBP:insider-web jeff [develop] $ cat divshot.json
{
  "name": "insider-web",
  "root": "./",
  "clean_urls": true,
  "error_page": "error.html",
  "proxy": {
    "api": {
      "origin": "http://oa-mobile.herokuapp.com",
      "headers": {
        "Accept": "application/json"
      },
      "cookies": false,
      "timeout": 30
    }
  }
}
Jeffs-rMBP:insider-web jeff [develop] $ 

以下是生成的firebase.json文件:

Jeffs-rMBP:insider-web jeff [develop] $ cat firebase.json 
{
  "firebase": "insider",
  "public": "./",
  "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
  ]
}
Jeffs-rMBP:insider-web jeff [develop] $ 

附加说明: 我能够成功运行firebase serve并在localhost:5000本地启动我的应用 - 我的初始着陆页成功呈现并且行为正确。

1 个答案:

答案 0 :(得分:1)

您需要通过命令行登录:

firebase login

这将打开一个浏览器窗口,供您通过Google帐户登录。确保它是拥有insider Firebase应用程序的帐户。

根据您所拥有的内容,您当前拥有的唯一Firebase名为glowing-heat-3960。更改firebase中的firebase.json媒体资源。

{
  "firebase": "glowing-heat-3960",
  "public": "./",
  "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
  ]
}

之后,您应该能够成功部署。