Skip to content
We Have Enough Web Servers (So Here's Another One)
Ruby HTML
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
lib
spec
views
.gitignore
Gemfile
Gemfile.lock
README.md

README.md

WHEWS - We Have Enough Web Servers (So Here's Another One)

An HTTP server modeled on Ruby on Rails built on WEBrick using Ruby metaprogramming.

Built to gain a deeper understanding of Rails.

Features included:

  • Sessions using cookies
  • ERB Templating for Views
  • RESTful routing
  • Params (parses request body and query string)

TODO

  • Add Flash class which includes a #now method
  • "Strong Parameters"
  • Add Route Helpers (link_to, button_to)
  • Add CSRF Tokens
  • Add View partials
  • Nested Routing
  • User-defined helpers

How to use:

  • Initialize new router and server objects (example in: bin/router_server.rb)
  • Router#run sets the HTTP response body and content-type according to its inputs
  • Router#draw takes a pattern, controller_class, and action_name to create a route for an HTTP request.
You can’t perform that action at this time.