0.10.0 • Published 6 years ago

crud-file-server v0.10.0

Weekly downloads
6
License
unlicense
Repository
github
Last release
6 years ago

build status

crud-file-server

This package exposes a directory and its children to create, read, update, and delete operations over http.

Command-line usage

 crud-file-server [options]

This starts a file server using the specified command-line options.

-f file system path to expose over http
-h log head requests
-p port to listen on (example, 80)
-q suppress this message
-r read only
-v virtual path to host the file server on	

Example:

crud-file-server -f c:/ -p 8080 -q -v filez	

Supported operations

GET returns a file's contents with the correct mime type, or else the contents of a directory as html.

GET http://localhost?type=json formats content as json instead of the default type. This works for directories and files.

HEAD is the same as a GET, omitting the body.

PUT can be used to write a file.

DELETE can be used to delete a file or folder.

POST supports two operations, rename and create directory.

POST http://localhost/newDir?create=directory would create a directory named newDir.

POST http://localhost/abc.html?rename=def.html would rename abc.html to def.html.

Run the Example

For further clarification, try running the example.

npm install crud-file-server

Navigate to the example directory (which should now be under node_modules/crud-file-server/example).

cd node_modules/crud-file-server/example

Run crud-file-server to host the current directory.

crud-file-server -p 3300
	

Now use your browser to navigate to http://localhost:3300/example.html.
You will see a simple client that lets you interact with your file system from the web browser.

0.10.0

6 years ago

0.9.0

6 years ago

0.8.0

6 years ago

0.7.0

7 years ago

0.6.0

9 years ago

0.5.0

10 years ago

0.4.1

11 years ago

0.2.3

12 years ago

0.2.2

12 years ago

0.2.1

12 years ago

0.2.0

12 years ago

0.1.9

12 years ago

0.1.8

12 years ago

0.1.7

12 years ago

0.1.6

12 years ago

0.1.5

12 years ago

0.1.4

12 years ago

0.1.3

12 years ago

0.1.2

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago

0.0.9

12 years ago

0.0.7

12 years ago

0.0.6

12 years ago

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago