Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Latest commit

 

History

History
46 lines (35 loc) · 1.27 KB

README.md

File metadata and controls

46 lines (35 loc) · 1.27 KB

smoothie-cms

Content (Pages, Posts, Comments, etc) Server for smoothie-web

Requires NodeJS v12, there is a Dockerfile provided.

Don't forget to set these environment variables

MYSQL_HOST
MYSQL_USER
MYSQL_PASS
MYSQL_DB

API

GET "/pages" - Returns a PageResponse with all pages.

POST "/pages" - Accepts a JSON Page object in the body, and creates that page. Returns an empty PageResponse.

PUT "/pages" - Accepts a JSON PageUpdateRequest object, which consists of an updated Page object, and the slug to be updated.

GET "/pages/{slug}" - Returns a PageResponse with a single page (by slug).

GET "/pages/rendered/{slug}" - Returns a PageResponse with a single page, that is rendered with EJS and Markdown support. A JSON object in the request body will be passed to EJS.

GET "/navs/{parent}" - Returns a PageResponse with all pages with the specified parent, and has "display_on_nav" set to to true.

PageResponse

{"status": true, "error": "", "pages": []}

Page

{
    "id": 1,
    "slug": "hello-world",
    "date": "2020-01-07T05:00:00.000Z",
    "display_on_nav": 1,
    "parent": 0,
    "nav_title": "Hello World",
    "title": "Hello World Page",
    "meta": "This is a test page.",
    "content": "<em>This is some coool content.</em>"
}