https://github.com/jonmagic/ruby-web-server
Just learning how to build a web server with Ruby.
https://github.com/jonmagic/ruby-web-server
Last synced: 4 months ago
JSON representation
Just learning how to build a web server with Ruby.
- Host: GitHub
- URL: https://github.com/jonmagic/ruby-web-server
- Owner: jonmagic
- Created: 2016-01-22T06:36:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-22T06:44:15.000Z (over 9 years ago)
- Last Synced: 2025-01-31T13:43:48.520Z (5 months ago)
- Language: Ruby
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ruby web server
Me learning how to build a web server with Ruby.
In one terminal clone this repo, cd into the directory, and then run:
```bash
$ ruby server.rb
```In another terminal use curl to send a request to the server:
```bash
$ curl -d "hello world" http://localhost:2000?foo=bar
```And you should get back something like this:
```
POST
/
foo=bar
{"Host"=>"localhost:2000", "User-Agent"=>"curl/7.43.0", "Accept"=>"*/*", "Content-Length"=>"11", "Content-Type"=>"application/x-www-form-urlencoded"}
hello world
```