Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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)
- Host: GitHub
- URL: https://github.com/talaatmagdyx/http-server-in-ruby-from-scratch
- Owner: talaatmagdyx
- Created: 2022-01-11T21:01:05.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-21T08:51:31.000Z (over 2 years ago)
- Last Synced: 2024-10-10T06:41:28.517Z (about 1 month ago)
- Topics: http-server, rack, ruby
- Language: Ruby
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```