Skip to content

eyedea-io/syncano-socket-document-generator

Repository files navigation

Syncano Socket for generating documents from mustache templates

Syncano Socket CircleCI branch Codecov branch JavaScript Style Guide npm license

Main Socket features:

  • document-generator/generate — generate document

Getting Started

Install package in your project:

cd my_project
npm install @syncano/cli --save-dev
npm install @eyedea-sockets/document-generator --save
npx s deploy

Use it:

import Syncano from '@syncano/client'

const s = new Syncano(<instaneName>)

const params = {
  template: '<p>Hello, my name is {{firstName}}</p>',
  data: {
    firstName: 'John'
  }
}
const generatedDoc = await s.post('document-generator/generate', params)

Endpoints

document-generator/generate

Input:

Parameter Type Description Example
template string Template <p>Hello, my name is {{firstName}}</p>
data object Data {firstName: 'John'}

Outputs:

success - Operation Successful

  • Code: 200
  • Mimetype: text/html

fail - Operation failed

  • Code: 400
  • Mimetype: application/json
Parameter Type Description Example
message string Invitation failed Internal error.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published