The api server for mazimd
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
src
.gitignore
README.md
gulpfile.js
package-lock.json
package.json
tsconfig.json
tslint.json

README.md

mazimd-api

The api server for mazimd

http://api.mazimd.com

Getting Started

  1. Install Node.js
  2. Install and run MongoDB
  3. npm install
  4. npm start
  5. Visit http://localhost:8110

API

Get a page

GET /pages/:id

Response

Status: 200 OK
{
  "url": "http://api.mazimd.com/pages/1gyf5gloc",
  "html_url": "http://mazimd.com/pages/1gyf5gloc",
  "id": "1gyf5gloc",
  "content": "# Hello World",
  "created_at": "2017-06-28T06:56:17.244Z"
}

Create a page

POST /pages

Input

{
  "content": "# Hello World",
  "expire_in": "1h"
}

Response

Status: 201 Created
{
  "url": "http://api.mazimd.com/pages/1gyf5gloc",
  "html_url": "http://mazimd.com/pages/1gyf5gloc",
  "id": "1gyf5gloc",
  "content": "# Hello World",
  "created_at": "2017-06-28T06:56:17.244Z"
}

Get a theme

GET /themes/:id

Response

Status: 200 OK
{
  "url": "http://api.mazimd.com/themes/y7v359y4",
  "html_url": "http://mazimd.com/themes/y7v359y4",
  "id": "y7v359y4",
  "name": "Test theme",
  "css": "h1 { background: red; }",
  "created_at": "2017-06-30T03:08:12.688Z"
}

Create a theme

POST /themes

Input

{
  "name": "Base theme",
  "css": "# Hello World"
}

Response

Status: 201 Created
{
  "url": "http://api.mazimd.com/themes/y7v359y4",
  "html_url": "http://mazimd.com/themes/y7v359y4",
  "id": "y7v359y4",
  "name": "Test theme",
  "css": "h1 { background: red; }",
  "created_at": "2017-06-30T03:08:12.688Z"
}

List all themes

GET /themes

Response

[
  {
    "url": "http://api.mazimd.com/themes/y7v359y4",
    "html_url": "http://mazimd.com/themes/y7v359y4",
    "id": "y7v359y4",
    "name": "Test theme",
    "created_at": "2017-06-30T03:08:12.688Z"
  }
]