https://github.com/codeestx/my-restful-api
My RESTful API based on node.js & koa2
https://github.com/codeestx/my-restful-api
Last synced: 3 months ago
JSON representation
My RESTful API based on node.js & koa2
- Host: GitHub
- URL: https://github.com/codeestx/my-restful-api
- Owner: codeestX
- License: mit
- Created: 2016-09-18T16:34:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-09T15:23:48.000Z (over 8 years ago)
- Last Synced: 2025-04-10T03:17:34.465Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 5.38 MB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
基于node.js + koa2搭建的restfulapi demo,扩展自[learn-javascript](https://github.com/michaelliao/learn-javascript),基本涵盖了主要的api类型,联动文章:[编写](http://codeest.cn/2016/09/21/web-api-code/) [部署](http://codeest.cn/2016/09/24/web-api/)
#Usage
项目目录下执行,`node start`* GET (json)
`http://localhost:3000/api/geeknews/version`
`http://localhost:3000/api/products`* GET (image)
`http://localhost:3000/img/test.jpg`* GET (file)
`http://localhost:3000/apk/geeknews.apk`* POST (json)
`http://localhost:3000/api/products`
body {"name":"XBox","price":3999}* DELETE (json)
`http://localhost:3000/api/products/p1`