REST API framework for Nim language
84
stars
95
commits
Nim
primary language
Sep 7, 2026
updated
Presto is an asynchronous REST framework for Nim, built on top of the Chronos async I/O library. It provides:
You can use Nim's official package manager Nimble to install Presto:
$ nimble install presto
To depend on Presto from your own package, add it to your .nimble file:
requires "presto"
Full documentation is available as a book at
status-im.github.io/nim-presto, with
generated API reference under /api.
A minimal server looks like this:
import pkg/presto
proc decodeString*(t: typedesc[string], value: string): RestResult[string] =
ok(value)
proc validate(pattern: string, value: string): int = 0
var router = RestRouter.init(validate)
router.api(MethodGet, "/") do () -> RestApiResponse:
RestApiResponse.response("Hello World", Http200, "text/plain")
let server = RestServerRef.new(router, initTAddress("127.0.0.1:9000")).get()
server.start()
runForever()
When submitting pull requests, please add test cases for any new features or fixes and make sure nimble test is still able to execute the entire test suite successfully.
To build the documentation locally you need mdBook
with the toc, open-on-gh, admonish, and shiftinclude preprocessors:
$ nimble docs # generates both the API docs and the book into ./docs
Licensed and distributed under either of
or
at your option. These files may not be copied, modified, or distributed except according to those terms.
Nim
95.0%
CSS
4.9%
REST API framework for Nim language
84
stars
95
commits
Nim
primary language
Sep 7, 2026
updated
Presto is an asynchronous REST framework for Nim, built on top of the Chronos async I/O library. It provides:
You can use Nim's official package manager Nimble to install Presto:
$ nimble install presto
To depend on Presto from your own package, add it to your .nimble file:
requires "presto"
Full documentation is available as a book at
status-im.github.io/nim-presto, with
generated API reference under /api.
A minimal server looks like this:
import pkg/presto
proc decodeString*(t: typedesc[string], value: string): RestResult[string] =
ok(value)
proc validate(pattern: string, value: string): int = 0
var router = RestRouter.init(validate)
router.api(MethodGet, "/") do () -> RestApiResponse:
RestApiResponse.response("Hello World", Http200, "text/plain")
let server = RestServerRef.new(router, initTAddress("127.0.0.1:9000")).get()
server.start()
runForever()
When submitting pull requests, please add test cases for any new features or fixes and make sure nimble test is still able to execute the entire test suite successfully.
To build the documentation locally you need mdBook
with the toc, open-on-gh, admonish, and shiftinclude preprocessors:
$ nimble docs # generates both the API docs and the book into ./docs
Licensed and distributed under either of
or
at your option. These files may not be copied, modified, or distributed except according to those terms.
Nim
95.0%
CSS
4.9%