apeman-service-api
Version:
Apeman service for API access.
224 lines (130 loc) • 5.4 kB
Markdown
apeman-service-api
==========
<!---
This file is generated by ape-tmpl. Do not update manually.
--->
<!-- Badge Start -->
<a name="badges"></a>
[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url]
[![JS Standard][bd_standard_shield_url]][bd_standard_url]
[bd_repo_url]: https://github.com/apeman-service-labo/apeman-service-api
[bd_travis_url]: http://travis-ci.org/apeman-service-labo/apeman-service-api
[bd_travis_shield_url]: http://img.shields.io/travis/apeman-service-labo/apeman-service-api.svg?style=flat
[bd_travis_com_url]: http://travis-ci.com/apeman-service-labo/apeman-service-api
[bd_travis_com_shield_url]: https://api.travis-ci.com/apeman-service-labo/apeman-service-api.svg?token=
[bd_license_url]: https://github.com/apeman-service-labo/apeman-service-api/blob/master/LICENSE
[bd_codeclimate_url]: http://codeclimate.com/github/apeman-service-labo/apeman-service-api
[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/apeman-service-labo/apeman-service-api.svg?style=flat
[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/apeman-service-labo/apeman-service-api.svg?style=flat
[bd_gemnasium_url]: https://gemnasium.com/apeman-service-labo/apeman-service-api
[bd_gemnasium_shield_url]: https://gemnasium.com/apeman-service-labo/apeman-service-api.svg
[bd_npm_url]: http://www.npmjs.org/package/apeman-service-api
[bd_npm_shield_url]: http://img.shields.io/npm/v/apeman-service-api.svg?style=flat
[bd_standard_url]: http://standardjs.com/
[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
<!-- Badge End -->
<!-- Description Start -->
<a name="description"></a>
Apeman service for API access.
<!-- Description End -->
<!-- Overview Start -->
<a name="overview"></a>
<!-- Overview End -->
<!-- Sections Start -->
<a name="sections"></a>
<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->
<a name="section-doc-guides-01-installation-md"></a>
Installation
-----
```bash
$ npm install apeman-service-api --save
```
<!-- Section from "doc/guides/01.Installation.md.hbs" End -->
<!-- Section from "doc/guides/02.Usage.md.hbs" Start -->
<a name="section-doc-guides-02-usage-md"></a>
Usage
---------
```javascript
#!/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))
```
<!-- Section from "doc/guides/02.Usage.md.hbs" End -->
<!-- Section from "doc/guides/03.API.md.hbs" Start -->
<a name="section-doc-guides-03-a-p-i-md"></a>
API
---------
# apeman-service-api@2.1.1
Apeman service for API access.
+ Functions
+ [create(args)](#apeman-service-api-function-create)
+ [ApApiService](apeman-service-api-classes) Class
+ [new ApApiService(store, options)](#apeman-service-api-classes-ap-api-service-constructor)
+ [service.configure(url)](#apeman-service-api-classes-ap-api-service-configure)
+ [service.reach(args)](#apeman-service-api-classes-ap-api-service-reach)
+ [service.use(name)](#apeman-service-api-classes-ap-api-service-use)
+ [service.url(pathname)](#apeman-service-api-classes-ap-api-service-url)
## Functions
<a class='md-heading-link' name="apeman-service-api-function-create" ></a>
### create(args) -> `ApApiService`
Create the service instance
| Param | Type | Description |
| ----- | --- | -------- |
| args | * | |
<a class='md-heading-link' name="apeman-service-api-classes"></a>
## ApApiService Class
Service
<a class='md-heading-link' name="apeman-service-api-classes-ap-api-service-constructor" ></a>
### new ApApiService(store, options)
Constructor of ApApiService class
| Param | Type | Description |
| ----- | --- | -------- |
| store | Object | Redux store |
| options | Object | Optional settings |
<a class='md-heading-link' name="apeman-service-api-classes-ap-api-service-configure" ></a>
### service.configure(url)
Configure api
| Param | Type | Description |
| ----- | --- | -------- |
| url | string | |
<a class='md-heading-link' name="apeman-service-api-classes-ap-api-service-reach" ></a>
### service.reach(args) -> `*`
Test reachability of the API
| Param | Type | Description |
| ----- | --- | -------- |
| args | | |
<a class='md-heading-link' name="apeman-service-api-classes-ap-api-service-use" ></a>
### service.use(name) -> `*`
Use api
| Param | Type | Description |
| ----- | --- | -------- |
| name | string | Name of API |
<a class='md-heading-link' name="apeman-service-api-classes-ap-api-service-url" ></a>
### service.url(pathname) -> `string`
Get url
| Param | Type | Description |
| ----- | --- | -------- |
| pathname | string | Url path name |
<!-- Section from "doc/guides/03.API.md.hbs" End -->
<!-- Sections Start -->
<!-- LICENSE Start -->
<a name="license"></a>
License
-------
This software is released under the [MIT License](https://github.com/apeman-service-labo/apeman-service-api/blob/master/LICENSE).
<!-- LICENSE End -->
<!-- Links Start -->
<a name="links"></a>
Links
------
+ [apeman][apeman_url]
[apeman_url]: https://github.com/apeman-labo/apeman
<!-- Links End -->