USING: math kernel accessors http.server http.server.dispatchers furnace furnace.actions furnace.sessions furnace.redirection html.components html.forms html.templates.chloe fry urls ; IN: webapps.counter SYMBOL: count TUPLE: counter-app < dispatcher ; M: counter-app init-session* drop 0 count sset ; : ( quot -- action ) swap '[ count , schange URL" $counter-app" ] >>submit ; : ( -- action ) [ count sget "counter" set-value ] >>init { counter-app "counter" } >>template ; : ( -- responder ) counter-app new-dispatcher [ 1+ ] "inc" add-responder [ 1- ] "dec" add-responder "" add-responder ;