Created
July 11, 2022 16:35
-
-
Save AbhimanyuAryan/4c02a5ad17bf5532a427f99ec5309e11 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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