https://github.com/qustavo/exposefs
Let's RESTify your filesystem
https://github.com/qustavo/exposefs
Last synced: 10 days ago
JSON representation
Let's RESTify your filesystem
- Host: GitHub
- URL: https://github.com/qustavo/exposefs
- Owner: qustavo
- Created: 2014-05-30T20:01:27.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-10-01T18:58:16.000Z (over 10 years ago)
- Last Synced: 2025-04-10T05:14:57.433Z (13 days ago)
- Language: JavaScript
- Size: 270 KB
- Stars: 4
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## ExposeFS
[](https://travis-ci.org/gchaincl/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.
```javascript
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
| action | verb | operation | note |
|--------|------|-----------|---------|
| List Directory | `GET` | readdir |
| Retrieve file | `GET` | read |
| Stat file | `GET` | stat | must use `?stat` |
| Follow a file | `GET` | follow | must use `?follow` |
| Create File | `POST` | write |
| Create Directory | `POST` | mkdir | file name must finish with `/` |
| Append to File | `PUT` | write |
| Update file timestamps | `PATCH` | utimes |
| Remove a file or directory | `DELETE` | unlink |## TODO:
* Testing
* Add different backends (dropbox, s3, etc)