Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fernandospr/simple-file-server

This is a simple NodeJS file server
https://github.com/fernandospr/simple-file-server

Last synced: 20 days ago
JSON representation

This is a simple NodeJS file server

Awesome Lists containing this project

README

        

# simple-file-server
This is a simple NodeJS file server that allows to host files.

## Quick Setup

* Install NodeJS
* Install packages:
```
$ npm install
```
* Run the app:
```
$ node app.js
```

## Usage

### To upload a file
Make a `POST` request to `/files` using `content-type: multipart/form-data` header and a `file` field containing the path to the file you want to upload.

#### curl example
```
curl -X POST \
http://localhost:3000/files \
-H 'content-type: multipart/form-data' \
-F file=@/Users/fsproviero/Desktop/my-filename
```

### To retrieve a file
Make a `GET` request to `/files/my-filename`