Skip to content

gKushagra/cdn-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open File Server

File server implemented using Node.js for personal use. Currently supports uploading and downloading a file.

Upload a file using CURL

CURL 
-X POST
-H "Content-Type: multipart/form-data"
-F "data=@/path/to/file"
http://localhost:port/file/upload/:id

Every user can have a root directory. id is root directory name.

Download a file using CURL

CURL 
-X POST
-H "Content-Type: application/json"
-d '{"filePath":"public/:id/filename.ext"}'
http://localhost:port/file/upload/:id
-o filename.ext

Run Locally

Clone the repository and

npm install
npm run dev OR npm start

Build and Deploy

npm run build

Dependencies