add simple Ruby-based webserver to present recipes
This commit is contained in:
parent
cc3cd7c19f
commit
4c0ad819d7
13
web/server.rb
Normal file
13
web/server.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
# server.rb
|
||||
require 'sinatra'
|
||||
require 'htmlentities'
|
||||
|
||||
get '/' do
|
||||
`cd ..; echo "(display (html-wrap (cookbook-as-html cookbook)))" | petite -q "batch.scm"`
|
||||
end
|
||||
|
||||
get '/:ingredient' do
|
||||
ingredient = HTMLEntities.new.decode params['ingredient']
|
||||
puts ingredient
|
||||
`cd ..; echo "(display (html-wrap (cookbook-as-html (recipes-by-ingredients cookbook '(\\"#{ingredient}\\")))))" | petite -q "batch.scm"`
|
||||
end
|
Loading…
Reference in New Issue
Block a user