Specification for backends for how to interact with the Web Write GUIs
All responses are returned in JSON and in the format of:
var response = {
// Success: Boolean
// Did the request complete successfully?
success: true,
// Message: String
// The success or error message of what we did
message: "Result returned successfully",
// Data: Whatever
data: null
}- Query String Fields:
extension: String - searches within the extension- e.g.
"md"
- e.g.
mime: String - searches within the MIME content type- e.g.
"image"
- e.g.
limit: Number - amount of items to return within the page- e.g.
10 - default
10
- e.g.
offset: Number - the offset of items to start the paging from- e.g.
15
- e.g.
page: Number - the page of data to return- e.g.
2 - default
1
- e.g.
filter: JSON - a NoSQL filter to apply- e.g.
{"relativePath": $startsWith: "a"}
- e.g.
additionFields: Array - extra fields to return- e.g.
["relativeOutDirPath', "contentRendered"]
- e.g.
var responseData = {
// Website Name
name: "My Website",
// Website URL
url: "My Website URL"
// Any custom file collections
customFileCollections: [
{
id: "posts",
relativePaths: ["post/2012-12-25 - Happy Christmas.html.md"]
}
],
// Files
// All files inside the website database
files: [
{
meta: {
title: "My Blog Post"
},
date: "2013-10-30T05:04:18.483Z",
relativePath: "/post/2012-12-25 - Happy Christmas.html.md",
filename: "2012-12-25 - Happy Christmas.html.md",
url: "/post/2012-12-25 - Happy Christmas.html",
contentType: "@todo",
encoding: "utf8", // or binary
source: "@todo",
contentRendered: "@todo"
}
]
};- Methods:
GETfetch the template data that will be attached (JSON'able values only - no circular objects or functions)
- Methods:
GETfetch the collections that we have and their details
- Methods:
GETfetch the files at that relative path or collectionPUTcreate a new file at that relative path or collectionPOSTupdate the file at that relative path or collectionDELETEdelete the files at that relative path or collection