LoginSignup
0
0

More than 1 year has passed since last update.

Vue.jsで掲示板を作ってみよう vol.3『firebaseをデプロイ』

Posted at
nuxt.config
export default {
  // Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
  ssr: false,
  mode:"spa",     <=(これをついか)
 npm init -y
Wrote to pj/board-app/package.json:

Firebaseの公式サイトからプロジェクトの作成をしますが、『Vue.jsで掲示板を作ってみよう vol.2』にとりくんだ方はパスして大丈夫です、もうすでにできているので!
もしやっていなければ=>https://qiita.com/MUSASHI-programing/private/6d20e32d2807c16aef33

デプロイの準備をしていきます!

npm install --save firebase

npm install -g firebase-tools

firebase login

初めてのログインでしたら、アカウントを選択し、「許可」をクリックしてください。

Success!

が出たらOKです。

次にプロジェクトをFirebaseプロジェクトとして初期化します。

firebase init
このように選択しましょう
? Which Firebase CLI features do you want to set up for this folder? Press Space to select features, then Enter to confirm your choices. =>Hosting: Configure and deploy Firebase Hosting sites

? Please select an option: =>Use an existing project
? Select a default Firebase project for this directory: =>qiita-board (あなたが作ったアプリを選択)
? What do you want to use as your public directory? public
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
? Set up automatic builds and deploys with GitHub? No

ここでpublicフォルダができました、publicのindex_htmlを削除します。

次に

yarn generate

するとdistというファイルができるので、publicのフォルダを消して、distの名前をpublicに変えてください。

publicのindex_htmlの

の直前に下のものをはりつけます。

スクリーンショット 2021-02-20 15.59.14.png

ようやくここまできましたデプロイしましょう!
vol.2をしたひとはfirebase deployで Deploy complete! が出るとURLが発行されます!

firebase deploy

vol.2をしていない人はfirebaseでアプリの登録をしなくてはいけません
今しても遅くないですよ!
=>https://qiita.com/MUSASHI-programing/private/6d20e32d2807c16aef33

参考記事
https://qiita.com/hiroki-harada/items/ca22ac177db68e3c3796

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0