apeman-service-api
v3.0.0
Published
Apeman service for API access.
Downloads
85
Readme
apeman-service-api
Apeman service for API access.
Installation
$ npm install apeman-service-api --saveUsage
#!/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
[email protected]
Apeman service for API access.
- Functions
- ApApiService Class
Functions
create(args) -> ApApiService
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 |
service.url(pathname) -> string
Get url
| Param | Type | Description | | ----- | --- | -------- | | pathname | string | Url path name |
License
This software is released under the MIT License.
