Postleaf / postleaf

Simple, beautiful publishing with Node.js.

Home Page:https://www.postleaf.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Postleaf API

ericbets opened this issue · comments

What about publishing a simple api for postleaf for major postleaf functionality?
Perhaps it would fit in as part of #27.

eg.

const postleaf = require("postleaf-api");
const api = postleaf.login("user","pass");
const post = api.post({ title:"Title", content:"This is a post", publish:true});

The app itself is [mostly] RESTful. You can already do every operation that happens internally with the API — it's just not documented yet. (Docs are a lot of work for one person, and things are still changing here and there in alpha.)

For now, take a look at the API router for the endpoints: https://github.com/Postleaf/postleaf/blob/master/source/routers/api_router.js

And the API controllers for parameters: https://github.com/Postleaf/postleaf/tree/master/source/controllers/api

Each controller method has comments that show params and responses if you need to start using it right away. 🙂