參考網址:URL
運行 server 命令為下列指令,並啟動於 3000 port
npm run server
- mongoose套件為 moongoDB官方的 ORM
- body-parser 為解析 HTTP requests的套件on
- utility 用來作 md5 加密
- superagent 用來發 http 請求,之後可以研究用 node 原生的 request 套件來實作
- cheerio 為 node 版的 jQuery,可以把 HTML 的 string 用 jQuery 的方式解析
- An app.js for configuring the application,
- db.js for specifying the connection to the database
- server.js for spinning up the node server on a specific port of your choice
- User.js for mongo Schema for User
- UserController.js contain the actions which control the flow of data into and from your database
- only HTTP methods which have a body are POST and PUT. Remember that
- POST man 使用時,put 和 POST 的body參數要使用 x-www-form-urlencoded
npm list 可以看到包的依賴關係