Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Route Params

This example shows you how to use and retrieve route params using the req[:params] property.

Usage

The req[:params] property stores all params in a hash which allows the user to access each param by using [":PARAM_NAME"]

require 'voffie_teapot'

port = 4567
server = VoffieTeapot.new(port)

server.get('/params/:example') do |req, res|
  p req[:params][":example"]
  res.body = req[:params]
end

server.listen