Skip to content

InCodeDevs/Templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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
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}.ic

List all Templates

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

Authors

License

GPL-3.0

Releases

No releases published

Packages

No packages published