dummy-link

Bukdu

Bukdu 🌌 is a web development framework for Julia

Readme

Bukdu 🌌

Travis CI CircleCI AppVeyor Codecov Coveralls

Bukdu is a web development framework for Julia (http://julialang.org).

It's influenced by Phoenix framework (http://phoenixframework.org).

importall Bukdu

type WelcomeController <: ApplicationController
end

index(::WelcomeController) = "hello world"

Router() do
    get("/", WelcomeController, index)
end

Bukdu.start(8080)

Endpoint

Use Endpoint to define the plug pipelines.

  • plug Plug.Logger to write the event logs.
  • plug Plug.Static to serve the static files.
  • plug Router to give the routes into the Endpoint. Endpoint() do plug(Plug.Logger) plug(Plug.Static, at="/", from="public") plug(Router) end

Working with params

Put conn::Conn to the controller. Now, params could be accessed by indexing the controller. For example

importall Bukdu

type CalculateController <: ApplicationController
    conn::Conn
end

function my_fn(c::CalculateController)
    q = c[:params]
    x, y = map(v -> parse(Int, v), (q[:x], q[:y]))
    render(JSON, x + 2*y)
end

Router() do
    get("/my_fn", CalculateController, my_fn)
end

Bukdu.start(8080)

Check it by querying with parameters. http://localhost:8080/my_fn?x=2&y=3

Deploy on Heroku

Bukdu can be deployed on Heroku. Go to the demo site (https://bukdu.herokuapp.com).

Jupyter notebook

First Commit

08/21/2016

Last Touched

1 day ago

Commits

137 commits

Used By: