인디노트

Firebase 에 NodeJS 초기화 본문

개발 플랫폼 및 언어/파이어베이스 Firebase

Firebase 에 NodeJS 초기화

인디개발자 2019. 8. 23. 15:49

초기 프로젝트 만드는 순서

ng new okey-kr

cd okey-kr

firebase init

 

참조 사이트

https://teraphonia.tistory.com/760

https://poiemaweb.com/angular-firebase

 

index.js

const functions = require('firebase-functions');
const express = require('express');
const app = express();

app.get('/timestamp', (req, res) => {
    res.send(`${Date.now()}`);
});

exports.app = functions.https.onRequest(app);

 

firebase.json

{
  "hosting": {
    "public": "dist",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [{
      "source": "**",
      "function": "app"
    
}],
    "cleanUrls": true
  },
  "database": {
    "rules": "database.rules.json"
  }
}

 

반응형
Comments