一個使用Node.js + Express製作的餐廳清單
功能:
- 使用者可以新增一家餐廳
- 使用者可以瀏覽一家餐廳的詳細資訊
- 使用者可以瀏覽全部所有餐廳
- 使用者可以修改一家餐廳的資訊
- 使用者可以刪除一家餐廳
待開發事項
- 搜尋功能
安裝流程:
- 打開terminal, clone此專案
git clone https://github.com/alvinkane/A1-restaurantList.git - 移到存取的資料夾(A1-restaurantList)
- 安裝npm套件
npm install - 安裝nodemon套件(若有可省略)
- 在專案內創造一個env檔案,並在其中輸入MongoDB connection string
MONGODB_ENV=mongodb+srv://<username>:<password>@<cluster>.pk4dwnp.mongodb.net/restaurant-list?retryWrites=true&w=majority - 匯入種子檔案
npm run seed - 出現'mongodb connected!' 'done' 代表成功
- 執行專案
npm run dev - 出現 "This is listening on http://localhost:3000" 'mongodb connected'代表成功
- 開啟任一瀏覽器輸入This is listening on http://localhost:3000
