«

egg RESTful

emer 发布于 2019-10-21 14:23   1834 次阅读     


Method Path Route Name Controller.Action
GET /posts posts app.controllers.posts.index
GET /posts/new new_post app.controllers.posts.new
GET /posts/:id post app.controllers.posts.show
GET /posts/:id/edit edit_post app.controllers.posts.edit
POST /posts posts app.controllers.posts.create
PUT /posts/:id post app.controllers.posts.update
DELETE /posts/:id post app.controllers.posts.destroy
// app/controller/posts.js exports.index = async () => {};  exports.new = async () => {};  exports.create = async () => {};  exports.show = async () => {};  exports.edit = async () => {};  exports.update = async () => {};  exports.destroy = async () => {};