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

https://github.com/neorandom/rust-http-server

HTTP server made in Rust from without external libraries
https://github.com/neorandom/rust-http-server

cargo get-request http http-server multithreading rust rust-lang

Last synced: 9 months ago
JSON representation

HTTP server made in Rust from without external libraries

Awesome Lists containing this project

README

          

# HTTP Server (in Rust!)

### A server based on HTTP made with Rust from Scratch.

### Supports multithreading and (only) GET requests.

## How to use:

Make sure that you have `cargo` and `rustc` installed in your computer

Run `cargo build --release` at the cmd to build an executable

Run `.\target\release\http-server.exe` to start the server

Access `http://:7878` to see the index page

> To download a file, access the endpoint `/file`. Example: `/file/filename.ext/p=`

> This project was only tested on Windows 10.

## Types of status code:

### 2xx: Success - The action was successfully received, understood, and accepted
- 200 Ok

### 4xx Client Error - The request contains bad syntax or cannot be fulfilled
- 400 Bad Request
- 404 Not Found

## Based on:

- https://doc.rust-lang.org/book/ch20-01-single-threaded.html

- https://doc.rust-lang.org/book/ch20-02-multithreaded.html

- https://doc.rust-lang.org/book/ch20-03-graceful-shutdown-and-cleanup.html

- Lots of research to improve even more

## Licence

#### This project is currently under a [LICENSE](LICENSE)