這是 Lidemy 學習系統後端原始碼,採用 Express + Sequelize 開發。
- 根據 Firebase 官方文件產生 JSON 設定檔,放到
config/firebase.json
- 新增
config/config.json
,格式為:
{
"development": {
"username": "",
"password": "",
"database": "",
"host": "127.0.0.1",
"dialect": "mysql"
},
"test": {
"username": "",
"password": "",
"database": "database_test",
"host": "127.0.0.1",
"dialect": "mysql"
},
"production": {
"username": "",
"password": "",
"database": "database_production",
"host": "127.0.0.1",
"dialect": "mysql"
}
}
接著請複製.env.example
並改名成.env
,並且設置裡面的環境變數:
- FIREBASE_DB_URL
- REGISTER_CODE
- SLACK_WEBHOOK_URL
最後 npm install
即可。
npm run dev
npm run pm2