sugo-endpoint-html
Sugo endpoint to server dynamic HTML
Requirements
![Node.js](https://realglobe-inc.github.io/sugos-assets/images/nodejs-banner.png)
![NPM](https://realglobe-inc.github.io/sugos-assets/images/npm-banner.png)
Installation
$ npm install sugo-endpoint-html --save
Usage
Create an instance and apply to sg-server (or sugo-cloud)
/** This is an example to use sugo-endpoint-html */ 'use strict' const sgServer = const sugoEndpointHTML = const renders = account: { // Returns html string to render return '<!DOCTYPE html><html><!- ... -></html>' } { return '<!DOCTYPE html><html><!- ... -></html>' } const server = server
Then call the api from agent script.
/** This is example of client */ 'use strict' const arequest = { let request = arequest let body statusCode = // Return values as response body console // -> <!DOCTYPE html><html><!-- ... --></html>}
Signature
sugoEndpointHtml(renderers, options) -> function
Sugo endpoint to server dynamic HTML
Args
Name | Type | Default | Description |
---|---|---|---|
renderers | Object<string, Object<string, function>> | Renderer functions | |
options | object | Optional settings. |
License
This software is released under the Apache-2.0 License.