Skip to content

Latest commit

 

History

History
67 lines (46 loc) · 2.07 KB

File metadata and controls

67 lines (46 loc) · 2.07 KB

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.