buildapi
install
npm install buildapi
How
buildapi
has two exports.
buildapi
This is API builder function.
Route class
Define route extending Route class. In Route class, you can use methods below.
const fileId = 'dkfjaklfjdkfldjsflksdf'const file = evtfile // File event object. this
- get
- post
- put
- delete
- head
- option
- download
Usage
At first, define your routes extending Route
object.
file_route.js
const e = encodeURIComponent { return this } { return this } { return this } { return this } { return this } { return this } { return this } { return this }
And build your api with buildapi
.
api.js
const routes = File moduleexports =
And use api.
const api = // you can override api point. api: 'staging.server.api' // access to endpoint.apifile // return Promise object
Authorize support
buildapi
supports Oauth token.
const api = // instanciate your api.api
This set request header Authorization section internally.
req
Author
Yusuke Shibata
Lisense
MIT