LowDB Blog is a LowDB (ya don't say?) and jQuery powered blog with a full private and public API. This repository is updated frequently.
- Run
npm install
- Set a secret in
secret.example.json
. Make it complicated, like a hard password, (ex: 48zu-QdF5a-dS) with URL friendly characters. - Rename
secret.example.json
to "secret.json". (In production use environmental variables) - Set Meta data and Posts via the API or
db.json
(In production store data in.data/db.json
) - Run
node server.js
The API is relatively simple to understand and use. It is based around post requests and your .env
secret you set earlier. Examples are shown in jQuery.
_End Point /posts/new
Parameters title
,date
,body
, and token
.
Example $.post("/posts/new", { title: "Title", date: "Month Day, body: "Lorem ipsum...", token: "TOKENHERE"});
All queries are required.
End Point /meta/:ID
IDsuser
,bio
,link
,photo
, photo
, and title
.
Parameters value
, text
, and token
.
Example $.post("/meta/bio", { value: "Lorem ipsum...", token: "TOKENHERE"});
Example 2 $.post("/meta/link", { text: "Google", value: "google.com", token: "TOKENHERE"});
All queries are required expres text. Text is used only for the link
ID.
The public API is a read only version of the LowDB json file.
End Point /api/v1