Skip to content

octoi/file-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

FILE API

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 here
  • GET /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)

SETUP

  1. Using Rust & Cargo

    You need Rust & Cargo installed to get started

    move to the folder api and run

    $ cargo run
  2. Using Docker

    You need Docker installed for this

    $ docker build -t file-api
    $ docker run -p 8080:8080 file-api