Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/talaatmagdyx/http-server-in-ruby-from-scratch

A rack compatible HTTP server from scratch using only Ruby Resources (education only)
https://github.com/talaatmagdyx/http-server-in-ruby-from-scratch

http-server rack ruby

Last synced: 15 days ago
JSON representation

A rack compatible HTTP server from scratch using only Ruby Resources (education only)

Awesome Lists containing this project

README

        

# Multi-threaded Ruby HTTP Server from Scratch with Rack / Rails support

This is a basic HTTP server built from scratch using only Ruby.

* It starts a new thread for each connection.
* It checks for files on disk and serves them up if they exists (**Note: this is not production ready**)
* If no file exists, it will fallback to a Rack application defined as `APP`. This can be any Rack app, including Rails.
* Errors from Rack applications are logged and a 500 error is automatically returned

# how to run
- for rack
```
ruby server_rack.rb
```

- for rails
```
ruby server_rails.rb
```