Endpoints
An endpoint is one path in your API. It is a folder in datahoster-endpoints, named for the path it answers on. Inside it, up to four JSON files declare the operations that path supports and how each works. The endpoint answers at one public path, <domain>/<endpoint>, and the HTTP method chooses which operation runs: GET a select, POST an insert, PUT an update, DELETE a delete. Endpoints are the only way in: a collection holds no permissions and is never reached directly, so your API is exactly the set of endpoints you define, and it stays stable while the collections behind it change.
<datahoster-config-contentRoot>/
api.example.com/
datahoster-endpoints/
submit/ a public insert, /submit
datahoster-endpoint-insert.json
inbox/ a private read, /inbox
datahoster-endpoint-select.json
Contents
Each folder in datahoster-endpoints is one endpoint, named for the path it answers on. Inside it, up to four JSON files declare the operations it supports; include only the ones you want. Each file names a collection, carries a permission (a -public flag and a -users list), and may give each exposed column a public name with an -as. The four are fixed file names, one per operation.
| Name | Type | Description |
|---|---|---|
datahoster-endpoint-select.json | file | A read (GET): returns a filtered table from a collection. |
datahoster-endpoint-insert.json | file | A write (POST) that adds a record. |
datahoster-endpoint-update.json | file | A write (PUT) that changes a record, by id. |
datahoster-endpoint-delete.json | file | A write (DELETE) that removes a record, by id. |