Blossom is a minimalistic web framework built in nim languge largely inspired by Bottle, Redstone and Jester.
import sugar
import blossom
proc main() =
# Initialize application
let settings = newSettings()
var blossom = initApp(settings)
# Add a couple of routes
blossom.router.addRoute("/",
proc(req: Request): Future[void] =
req.respond(Http200, "Blossom is gorgeous!")
)
# And route with sugar macro
blossom.router.addRoute("/sugar", (req: Request) =>
req.respond(Http200, "Sugar is sweet!")
)
# Start server
blossom.serve()
when isMainModule:
main()
- Static routing
- Dynamic routing
- Templating
- Logging
Icon generously provided by Icons8.