1.0.2 • Published 3 years ago

@incodelang/templates v1.0.2

Weekly downloads
-
License
GPL-3.0-only
Repository
-
Last release
3 years ago

@incodelang/templates

A Server for storing templates

Installation

Install @incodelang/templates with npm

  npm install @incodelang/templates

Install @incodelang/templates with yarn

  yarn add @incodelang/templates

Usage/Examples

Integrate in your own express.js application

const { templateServer } = require('@incodelang/templats')
const express = require('express')

const app = express();

app.listen(3000, "0.0.0.0");

templateServer({
    app: app
})

Standalone express.js application

const { templateServer, sampleApp } = require('@incodelang/templates')

templateServer({
    app: sampleApp(
        3000, // port [default] = 3000
        "0.0.0.0" // host [default] = "0.0.0.0"
    )
})

API Reference

Upload Template

  GET /api/v1/template/upload
ParameterTypeDescription
typemonaco or blocklyThe type of the template
namestringThe name of the template
codestringThe actual code

Download Template

  GET /api/v1/template/data/templates/{name}.ic

List all Templates

  GET /api/v1/template/data/templates.json

Authors

License

GPL-3.0