apeman-app-sse
apeman app for sse (Server-Sent Events)
Installation
$ npm install apeman-app-sse --save
Usage
- Define an app within Apemanfile.js
- Call the app via apeman app command.
Apemanfile.js
/** This is an example Apemanfile to use apeman-app-sse */ 'use strict' moduleexports = $pkg: /* ... */ $apps: // Define your own app. 'my-app-01': // Map url and handlers. '/my-sse': { client client } // Options
Then,
$ apeman app my-app-01 -p 3000
Client slide script
'use strict' const EventSource = require let es = new EventSourcees.addEventListener
Signature
apemanAppSse(handler, options) -> function
apeman app for sse (Server-Sent Events)
Args
Name | Type | Default | Description |
---|---|---|---|
handler | function | SSE Client handler | |
options | object | Optional settings. |
License
This software is released under the MIT License.