Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

restfs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restfs

exposes your file system as a json rest api

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

restfs

restfs exposes your file system as a rest api via nodejs. this is not a static file server, but instead lets you browse stats, and manipulate files through arbitrary paths.

installation

$ npm install restfs

use

interface

you can create a restfs api using the standalone server or including it in your own. either method exposes a standard REST interface which currently implements the following methods:

  • GET /path/to/directory - returns stats for a collection of files
  • GET /path/to/file - returns stats for a specific file
  • POST /path/to/file - create a specific file
  • DELETE /path/to/file - removes a specific file

server

to start a simple server, simply run restfs. dir and port options are available, which default to process.cwd() and 8000 respectively. to browse a given directory from http://localhost:8000/, simply run

$ restfs

library

you can provide restfs as middleware to your http, connect, or express server. the restfs function accepts two arguments: path, and api_base which default to / and / respectively. for instance, to access the directory foo under my home directory /home/catshirt, via http://localhost/foo

var http = require('http'),
    restfs = require('../lib/restfs'),
    server = http.createServer();

server.on('request', restfs('/home/catshirt'));
server.listen(80);

Keywords

FAQs

Package last updated on 07 Jul 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc