Basics I’d expect from a web-based editor (which I think lead to endpoints):
- List source/content dir (HTTP GET)
- Returns either a nested
<ul>
or a JSON object that represents the source dir. A client would render this to give a user a visual overview of their content’s structure. - Read selected file from source/content dir (GET)
- Returns the file’s contents. Clients would render the file contents in their editor
- Delete items from the source/content dir (DELETE)
- Returns an HTTP 200 with a message saying the delete was successful
- Add new items to the source/content dir (POST)
- Returns 201 (created) with a location header with the new item’s URL.
- Save to a file in source/content dir (PUT. Assumes the file was already created above)
- Returns an HTTP 200 with a success message
- Rename items in the source/content dir, including moving to different sub-directories (POST or PUT, depending)
- Returns 200 if PUT (just a rename, or 201
Does that sort of give the color you’re looking for? Cutting my teeth here on open source contributions.