REST Server
Rest Server
See get_started/custom_class as well
GET
returns .json of layer components(classes) or events/commands. It also returns default values of compoent properties
@host=http://localhost:9090
### run pegasus server if not running, and return books
GET /app
###
GET /bookFree
###
GET /bookFree/page1
### selectLayer
GET /bookFree/page1/title
###
GET /bookFree/page1/title/linear
POST
receives Props of layers and Commands and then renders .lua components/commands. It also stores the request params in .json
### modify layer props
POST /bookFree/page1/title/?command=preview
Content-Type: application/yaml
{
alpha=0.5
}
### save layer props with the current value
POST /bookFree/page1/title/?command=save
Content-Type: application/yaml
PUT
creates a new lua file in App directory if not exist. scafolding a lua file
GET /app
###
GET /newBook
PUT /newBook
PUT /newBook/newPage
### update index.lua too
PUT /newBook/newPage/newLayer
PUT /newBook/newPage/newLayer/?class=linear
### custom class
GET /components/custom
PUT /components/custom/newClass
PUT /newBook/newPage/newLayer/?class=newClass
### events
GET /newBook/commands/newPage
PUT /newBook/commands/newPage/newEvent
DELETE
removes a lua file
###
DELETE /newBook/newPage/newLayer
DELETE /newBook/newPage/newLayer/?class=linear
### custom class?
DELETE /components/custom/newClass
DELETE /newBook/newPage/newLayer/?class=newClass
### events
DELETE /newBook/commands/newPage/newEvent