Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bevry-archive/webwrite
Specification for backends for how to interact with the Web Write GUIs
https://github.com/bevry-archive/webwrite
webwrite
Last synced: 3 days ago
JSON representation
Specification for backends for how to interact with the Web Write GUIs
- Host: GitHub
- URL: https://github.com/bevry-archive/webwrite
- Owner: bevry-archive
- License: mit
- Archived: true
- Created: 2013-08-27T09:23:41.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-11-06T07:12:01.000Z (about 11 years ago)
- Last Synced: 2024-08-02T12:42:37.250Z (3 months ago)
- Topics: webwrite
- Size: 113 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - bevry-archive/webwrite - Specification for backends for how to interact with the Web Write GUIs (others)
README
# Spec
Specification for backends for how to interact with the Web Write GUIs
## REST
All responses are returned in JSON and in the format of:
``` javascript
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
}
```### Route: `http://site.com/restapi/`
- Query String Fields:
- `extension`: String - searches within the extension
- e.g. `"md"`
- `mime`: String - searches within the MIME content type
- e.g. `"image"`
- `limit`: Number - amount of items to return within the page
- e.g. `10`
- default `10`
- `offset`: Number - the offset of items to start the paging from
- e.g. `15`
- `page`: Number - the page of data to return
- e.g. `2`
- default `1`
- `filter`: JSON - a NoSQL filter to apply
- e.g. `{"relativePath": $startsWith: "a"}`
- `additionFields`: Array - extra fields to return
- e.g. `["relativeOutDirPath', "contentRendered"]```` javascript
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"
}
]
};
```### Route: `http://site.com/restapi/template-data`
- Methods:
- `GET` fetch the template data that will be attached (JSON'able values only - no circular objects or functions)### Route: `http://site.com/restapi/collection/`
- Methods:
- `GET` fetch the collections that we have and their details### Route: `http://site.com/restapi/file/`
- Methods:
- `GET` fetch the files at that relative path or collection
- `PUT` create a new file at that relative path or collection
- `POST` update the file at that relative path or collection
- `DELETE` delete the files at that relative path or collection