apeman-service-api
Apeman service for API access.
Installation
$ npm install apeman-service-api --save
Usage
#!/usr/bin/env node
'use strict'
const { ApApiService } = require('apeman-service-api')
const { createStore } = require('redux')
const { reducer } = require('apeman-service-base')
const co = require('co')
co(function * () {
let store = createStore(reducer)
let service = new ApApiService(store)
}).catch((err) => console.error(err))
API
apeman-service-api@2.1.1
Apeman service for API access.
- Functions
- ApApiService Class
Functions
ApApiService
create(args) -> Create the service instance
Param | Type | Description |
---|---|---|
args | * |
ApApiService Class
Service
new ApApiService(store, options)
Constructor of ApApiService class
Param | Type | Description |
---|---|---|
store | Object | Redux store |
options | Object | Optional settings |
service.configure(url)
Configure api
Param | Type | Description |
---|---|---|
url | string |
*
service.reach(args) -> Test reachability of the API
Param | Type | Description |
---|---|---|
args |
*
service.use(name) -> Use api
Param | Type | Description |
---|---|---|
name | string | Name of API |
string
service.url(pathname) -> Get url
Param | Type | Description |
---|---|---|
pathname | string | Url path name |
License
This software is released under the MIT License.