sugo-demo-endpoint

1.0.15 • Public • Published

sugo-demo-endpoint

Build Status npm Version JS Standard

Demo of sugo endpoint

Requirements

Node.js NPM

Installation

$ npm install sugo-demo-endpoint --save

Usage

Create an instance and apply to sg-server (or sugo-cloud)

/** This is an example to use sugo-demo-endpoint */
 
'use strict'
 
const sgServer = require('sg-server')
 
const server = sgServer({
  middlewares: [
    /* ... */
  ],
  endpoints: {
    '/foo/bar': require('sugo-demo-endpoint')({
      // Options
    })
  }
})
 
server.listen(3000)
 
 

Then call the api from agent script.

/** This is example of client */
 
'use strict'
 
const sugoAgentBase = require('sugo-agent-base')
const co = require('co')
 
co(function * () {
  let agent = sugoAgentBase('/foo/bar')
  let knocked = yield agent.knock()
  /* .. */
}).catch((err) => console.error(err))
 

Signature

sugoDemoEndpoint(options) -> function

Demo of sugo endpoint

Args
Name Type Default Description
options object Optional settings.

License

This software is released under the Apache-2.0 License.

Links

Readme

Keywords

Package Sidebar

Install

npm i sugo-demo-endpoint

Weekly Downloads

2

Version

1.0.15

License

Apache-2.0

Last publish

Collaborators

  • realglobe