This package has been deprecated

Author message:

"!!NO LONGER_MAINTAINED"

apeman-app-link

3.0.1 • Public • Published

apeman-app-link

Build Status Code Climate Code Coverage npm Version JS Standard

apeman app to parse links for jsonapi.

Installation

$ npm install apeman-app-link --save

Usage

  1. Define an app within Apemanfile.js
  2. Call the app via apeman app command.

Apemanfile.js

/** This is an example Apemanfile to use apeman-app-link */
 
'use strict'
 
const co = require('co')
 
module.exports = {
  $pkg: { /* ... */ },
  $apps: {
    // Define your own app.
    'my-app-01': {
      // Map url and handlers.
      '/': [
        require('apeman-app-link')({
          // Options
          protocol: 'https',
          host: 'hoge.example.com'
        }),
        co.wrap(function * handler01 (ctx, next) {
          let link = ctx.link('/api/hoo/bar?page=1') // Resolve relative link to full path.
          /* ... */
        })
      ]
    }
  }
}
 

Then,

$ apeman app my-app-01 -p 3000

Signature

apemanAppLink(options) -> function

Resolve link url.

Args
Name Type Default Description
options object Optional settings.
options.protocol string http Link protocol.
options.host string Host setting.
options.pathname string Base pathname.

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i apeman-app-link

Weekly Downloads

3

Version

3.0.1

License

MIT

Last publish

Collaborators

  • okunishinishi