# Pastebin sDGQdmvD import tables type Request = object META*, POST*, FILES*, GET*: Table[string, string] user: string # Placeholder HttpResponse = object code*: int body*: string META*: Table[string, string] proc OK(resp: typedesc[HttpResponse], s: string): HttpResponse = result.code = 200 result.body = s # Fill META here... template newRoute(route: string, body: untyped) = var route_func = proc(request: Request): HttpResponse = body # routes.register route_func newRoute "/home/": return HttpResponse.OK("Welcome to my homepage!")