A simple file api made using rust 📂
Folder Name | Function |
---|---|
api | contains code for file-api |
files | all files will be saved in that folder |
test-site | a simple website for testing the upload endpoint |
Run server to get a server at http://localhost:8080 with two routes:
POST /upload
- you can upload a file hereGET /files/*
- download the uploaded files
The file is saved using a random id as a name, with the extension. The name is logged, so you can see that it worked.
The max file-size is configured at ~100 MB.
Thanks @zupzup for creating warp-upload-download-example (The most part of this project is copied from warp-upload-download-example
repo)
-
Using Rust & Cargo
You need
Rust
&Cargo
installed to get startedmove to the folder
api
and run$ cargo run
-
Using Docker
You need
Docker
installed for this$ docker build -t file-api
$ docker run -p 8080:8080 file-api