Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 30 days 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 (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-22T06:44:15.000Z (almost 9 years ago)
- Last Synced: 2023-04-10T22:39:33.526Z (over 1 year 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
```