@incodelang/templates
v1.0.2
Published
Server for storing templates
Readme
@incodelang/templates
A Server for storing templates
Installation
Install @incodelang/templates with npm
npm install @incodelang/templatesInstall @incodelang/templates with yarn
yarn add @incodelang/templatesUsage/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| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| type | monaco or blockly | The type of the template |
| name | string | The name of the template |
| code | string | The actual code |
Download Template
GET /api/v1/template/data/templates/{name}.icList all Templates
GET /api/v1/template/data/templates.json