node-mongoose-blog
只是实现某些后台接口, 没做web界面
npm install
npm run watch (chokidar 'src/**' -c 'npm run build')
npm start
- Category
- create
curl -i -X POST -H "'Content-type':'application/x-www-form-urlencoded', 'charset':'utf-8', 'Accept': 'text/plain'" -d 'data={"name":"yy直播","alias":"zhibo"}' http://localhost:3000/api/category/create
- get_all
curl -i http://localhost:3000/api/category/get_all
-
- api处用
export default
导出模块也是有问题, 已改为module.exports
- api处用
-
post
过来的数据需要JSON.parse
解析才能存进mongodb
, 好诡异的事情
-
- 用
curl
post
数据过来, 会出现中文乱码, 不知道是 node 这边的问题还是curl
这边的问题
- 用
-
- 现在还想不明白为啥
export default app
; 导出模块, 方法有问题, 读取不到[现改为module.exports = app
]
- 现在还想不明白为啥
-
- 实时监控编译还是有些问题
解决了:
chokidar-cli
必须全局安装, 并且chokidar 'src/**' -c 'npm run build'
才生效
- 实时监控编译还是有些问题
解决了: