Skip to content

Instantly share code, notes, and snippets.

@AbhimanyuAryan
Created July 11, 2022 16:35
Show Gist options
  • Save AbhimanyuAryan/4c02a5ad17bf5532a427f99ec5309e11 to your computer and use it in GitHub Desktop.
Save AbhimanyuAryan/4c02a5ad17bf5532a427f99ec5309e11 to your computer and use it in GitHub Desktop.
using Bukdu
struct WelcomeController <: ApplicationController
conn::Conn
end
struct RestController <: ApplicationController
conn::Conn
end
function index(c::WelcomeController)
render(JSON, "Hello World from Bukdu")
end
function init(c::RestController)
render(JSON, (:init, c.params.region, c.params.site_id, c.params.channel_id))
end
routes() do
get("/", WelcomeController, index)
get("/init/region/:region/site/:site_id/channel/:channel_id/",
RestController, init, :site_id=>Int, :channel_id=>Int)
end
Bukdu.start(7080)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment