Skip to content

Instantly share code, notes, and snippets.

@clintpachl
clintpachl / at_app.rb
Last active January 28, 2018 02:20
All apps should only match page[123], else return 404. Shows new Syro route match method `at`.
App = Syro.new do
on :token do
at 'page1' do
get { res.text 'page1' }
end
at 'page2' do
get { res.text 'page2' }
end
@clintpachl
clintpachl / app.rb
Created January 25, 2018 10:08
My first Syro app: a wiki!
App = Syro.new do
on 'wiki' do
if root?
run PageRouter, page: 'wiki'
else
run UtilityRouter
end
end
on :page do