0.0.2 • Published 10 years ago

exposefs v0.0.2

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

ExposeFS

Let's RESTify your filesystem

Usage

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

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

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

var exposefs = require('exposefs');

app.use('/fs', exposefs({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
Follow a fileGETfollowmust use ?follow
Create FilePOSTwrite
Create DirectoryPOSTmkdirfile name must finish with /
Append to FilePUTwrite
Update file timestampsPATCHutimes
Remove a file or directoryDELETEunlink

TODO:

  • Testing
  • Add different backends (dropbox, s3, etc)