0.1.0 • Published 6 years ago

express-rest-fs v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

ExpressRestFs

Let's RESTify your filesystem

Usage

./bin/expose [path] [port] will serve path (~ by default) at port (8000 by default).

As expressRestFs has been built as an express middleware, you can use it in your existing express application.

var express = require("express");
var app = express();

var expressRestFs = require("express-rest-fs");

app.use("/fs", expressRestFs({ basepath: "/home/" }));

/* your routing definition */

app.listen(8000);

The code above will serve your home directory under /fs url.

Exposed API

actionverboperationnote
List DirectoryGETreaddir
Retrieve fileGETread
Stat fileGETstatmust use ?stat
Create FilePOSTwrite
Create DirectoryPOSTmkdirfile name must finish with /
Append to FilePUTwrite
Update file timestampsPATCHutimes
Remove a file or directoryDELETEunlink

TODO:

  • Testing
  • Rethink status codes/responses
  • Caching headers
  • Resume
  • ...
0.1.0

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago