Firebase
#Serverless #Firebase
Auth
めっちゃ強い
認証そろってる。
JWTベース
てことは例えば認証だけ使ってRubyと組み合わせるとかできるはず
hosting
https://github.com/zeit/next.js/blob/canary/examples/with-firebase-hosting/src/functions/index.js
https://qiita.com/mizchi/items/60722563b8a938e7336f
GCP上でdockerで動かす系。やっぱめんどそ。
https://medium.com/google-cloud/next-js-tutorial-deploy-to-docker-on-google-cloud-container-engine-6b0c19dd8ecb
firebaseとnextjs、どっちもお互いにサンプル作ってる
https://github.com/zeit/next.js/tree/canary/examples/with-firebase-hosting-and-typescript
https://github.com/firebase/functions-samples/tree/master/nextjs-with-firebase-hosting
functionsはpackage.json無いとおこられる
https://github.com/zeit/next.js/blob/master/examples/with-firebase-hosting/package.json#L18-L19
なるほど。そのへんの事情とか考えるとコピーしちゃうのがいいわけか。
後々めんどくせーのでGCPのプロジェクトに紐づけといたほうが良い
https://qiita.com/niusounds/items/829780bdc45d34b4d1e7
onAuthStateChangedは未ログインを検出出来るものと考えて良さげ