1.0.1 • Published 4 years ago

express-file-hosting v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

File hosting

Install

git clone https://github.com/nulnow/express-file-hosting.git
cd express-file-hosting
npm install

Run the app

npm start

Run the app (dev mode)

npm run start:dev

Admin panel

Run the app in dev mode

npm run start:dev

Navigate to the http://localhost:6060/

Run the tests

npm test

API

The API to the app is described below.

Upload a files

Request

POST /upload

curl -F ‘data=@path/to/local/file’ http://localhost:6060/upload

Response

[{
    url: <url>,
    guid: <guid>,
    name: <name>
}]

Get a file

Request

GET /download/<guid>[/<filename>]

curl http://localhost:6060/download/<guid>[/<filename>] --output file.jpg

Response

<File body>