|
@ -1,12 +1,18 @@ |
|
|
require "kemal" |
|
|
require "kemal" |
|
|
require "./business.cr" |
|
|
require "./business.cr" |
|
|
|
|
|
|
|
|
get "/" do |
|
|
|
|
|
|
|
|
get "/:name" do |env| |
|
|
|
|
|
name = env.params.url["name"] |
|
|
count = Business.fetch_add(0); |
|
|
count = Business.fetch_add(0); |
|
|
render "./src/app/button.ecr"; |
|
|
render "./src/app/button.ecr"; |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
post "/" do |
|
|
|
|
|
count = Business.fetch_add(1); |
|
|
|
|
|
|
|
|
post "/:name" do |env| |
|
|
|
|
|
adder = 1; |
|
|
|
|
|
name = env.params.url["name"] |
|
|
|
|
|
if name == "archivist" |
|
|
|
|
|
adder = 10; |
|
|
|
|
|
end |
|
|
|
|
|
count = Business.fetch_add(adder); |
|
|
render "./src/app/button.ecr"; |
|
|
render "./src/app/button.ecr"; |
|
|
end |
|
|
end |