A Server for storing templates
Install @incodelang/templates with npm
npm install @incodelang/templates
Install @incodelang/templates with yarn
yarn add @incodelang/templates
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"
)
})
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 |
GET /api/v1/template/data/templates/{name}.ic
GET /api/v1/template/data/templates.json