status-im/nim-presto

REST API framework for Nim language

84

stars

95

commits

Nim

primary language

Sep 7, 2026

updated

status-im.github.io/nim-presto/

README

Presto - An efficient library for REST API implementation

Github action License: Apache License: MIT Stability: experimental

Presto is an asynchronous REST framework for Nim, built on top of the Chronos async I/O library. It provides:

  • a request router whose handlers receive path, query, and body parameters already unmarshalled into Nim types;
  • an HTTP and HTTPS server to run the router, or the option to embed it into an existing chronos server as middleware;
  • a strongly typed HTTP client generated at compile time from your own proc signatures;
  • built-in support for CORS and Prometheus-style metrics.

Installation

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"

Documentation

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()

Contributing

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

License

Licensed and distributed under either of

or

at your option. These files may not be copied, modified, or distributed except according to those terms.

Contributors

cheatfate

59 commits

arnetheduck

8 commits

narimiran

7 commits

tersec

6 commits

status-im/nim-presto

REST API framework for Nim language

84

stars

95

commits

Nim

primary language

Sep 7, 2026

updated

status-im.github.io/nim-presto/

README

Presto - An efficient library for REST API implementation

Github action License: Apache License: MIT Stability: experimental

Presto is an asynchronous REST framework for Nim, built on top of the Chronos async I/O library. It provides:

  • a request router whose handlers receive path, query, and body parameters already unmarshalled into Nim types;
  • an HTTP and HTTPS server to run the router, or the option to embed it into an existing chronos server as middleware;
  • a strongly typed HTTP client generated at compile time from your own proc signatures;
  • built-in support for CORS and Prometheus-style metrics.

Installation

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"

Documentation

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()

Contributing

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

License

Licensed and distributed under either of

or

at your option. These files may not be copied, modified, or distributed except according to those terms.

Contributors

cheatfate

59 commits

arnetheduck

8 commits

narimiran

7 commits

tersec

6 commits

Languages

Nim

95.0%

CSS

4.9%