Closed rriegs closed 6 years ago
The above commits implement the back end as described, but also permit PUT and DELETE to subdirectories of data
(creating and removing enclosing directories as appropriate) and return reasonable status codes for various kinds of errors.
Some enhancements that could be made in the future are:
At present, URLs ending in slash result in errors because fs
operations interpret these as paths to directories but expect only paths to files. It might be reasonable to strip the trailing slash or, alternately, to use the trailing slash to signal that a directory is expected (assuming the last bullet above is implemented).
This first cut of the back end will expose a REST API implementing wiki content storage via the file system. Each topic will be stored in its own file in the
data
directory. The following routes will be supported:/
: serve the contents ofindex.html
/*
: serve the contents of the file with the specified path/data/:file
: create or replace a file with the specified path/data/:file
: delete a fileCreated files may be topic content, images, or other embeddable data.