{"id":13726656,"url":"https://github.com/shawn-mcginty/naboris","last_synced_at":"2025-05-07T22:30:29.886Z","repository":{"id":38785785,"uuid":"177627070","full_name":"shawn-mcginty/naboris","owner":"shawn-mcginty","description":"Simple, fast, minimalist http server for OCaml/ReasonML","archived":false,"fork":false,"pushed_at":"2023-01-05T13:37:18.000Z","size":3714,"stargazers_count":71,"open_issues_count":18,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-14T17:47:16.498Z","etag":null,"topics":["http","http-server","ocaml","reasonml"],"latest_commit_sha":null,"homepage":"https://naboris.dev","language":"Reason","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shawn-mcginty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-25T16:47:13.000Z","updated_at":"2024-06-04T21:30:11.000Z","dependencies_parsed_at":"2022-08-26T05:00:56.299Z","dependency_job_id":null,"html_url":"https://github.com/shawn-mcginty/naboris","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawn-mcginty%2Fnaboris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawn-mcginty%2Fnaboris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawn-mcginty%2Fnaboris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawn-mcginty%2Fnaboris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shawn-mcginty","download_url":"https://codeload.github.com/shawn-mcginty/naboris/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252965069,"owners_count":21832817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["http","http-server","ocaml","reasonml"],"created_at":"2024-08-03T01:03:15.860Z","updated_at":"2025-05-07T22:30:27.992Z","avatar_url":"https://github.com/shawn-mcginty.png","language":"Reason","funding_links":[],"categories":["Reason"],"sub_categories":[],"readme":"\u003cimg src=\"https://raw.githubusercontent.com/shawn-mcginty/naboris/master/docs-src/static/logos/logo-w-text.svg\" height=\"36\" alt=\"naboris\" title=\"naboris\"\u003e\n\nSimple, fast, minimalist web framework for [OCaml](https://ocaml.org)/[ReasonML](https://reasonml.github.io) built on [httpaf](https://github.com/inhabitedtype/httpaf) and [lwt](https://github.com/ocsigen/lwt).\n\n[https://naboris.dev](https://naboris.dev)\n\n[![Build Status](https://travis-ci.com/shawn-mcginty/naboris.svg?branch=master)](https://travis-ci.com/shawn-mcginty/naboris)\n[![opam version 0.1.3](https://img.shields.io/static/v1?label=opam\u0026message=0.1.3\u0026color=E7C162)](https://opam.ocaml.org/packages/naboris/)\n\n```reason\n// ReasonML\nlet serverConfig: Naboris.ServerConfig.t(unit) = Naboris.ServerConfig.create()\n  |\u003e Naboris.ServerConfig.setRequestHandler((route, req, res) =\u003e switch(Naboris.Route.path(route)) {\n    | [\"hello\"] =\u003e\n      res\n        |\u003e Naboris.Res.status(200)\n        |\u003e Naboris.Res.text(req, \"Hello world!\");\n    | _ =\u003e\n      res\n        |\u003e Naboris.Res.status(404)\n        |\u003e Naboris.Res.text(req, \"Resource not found.\");\n  });\n\nLwt_main.run(Naboris.listenAndWaitForever(3000, serverConfig));\n/* In a browser navigate to http://localhost:3000/hello */\n```\n\n```ocaml\n(* OCaml *)\nlet server_config: unit Naboris.ServerConfig.t = Naboris.ServerConfig.create ()\n  |\u003e Naboris.ServerConfig.setRequestHandler(fun route req res -\u003e\n    match (Naboris.Route.path route) with\n      | [\"hello\"] -\u003e\n        res\n          |\u003e Naboris.Res.text req \"Hello world!\";\n      | _ -\u003e\n        res\n          |\u003e Naboris.Res.status 404\n          |\u003e Naboris.Res.text req \"Resource not found.\";\n  ) in\n\n\nlet _ = Lwt_main.run(Naboris.listenAndWaitForever 3000 server_config)\n(* In a browser navigate to http://localhost:3000/hello *)\n```\n\n\u003e Pre `1.0.0` the API may be changing a bit. A list of these changes will be kept below.\n\n## Contents\n* [Installation](#installation)\n* [Scaffolding](#scaffolding)\n* [naboris.dev](https://naboris.dev)\n* [Development](#development)\n* [Breaking Changes](#breaking-changes)\n\n### Installation\n\n#### Note\nNaboris makes heavy use of [Lwt](https://github.com/ocsigen/lwt#installing).  For better performance it is highly recommended _(however optional)_ to also install `conf-libev` which will configure [Lwt](https://github.com/ocsigen/lwt#installing) to run with the libev scheduler.  If you are using **esy** you will have to install `conf-libev` using a [special package](https://github.com/esy-packages/libev).\n\n`conf-libev` also requires that the libev be installed.  This can usually be done via your package manager. \n```bash\nbrew install libev\n```\nor\n```bash\napt install libev-dev\n```\n\n#### opam\n```bash\nopam install naboris\n```\n\n#### esy\n```json\n\"@opam/naboris\": \"^0.1.3\"\n```\n\n#### dune\n```\n(libraries naboris)\n```\n\n### Scaffolding\nFor a basic Reason project\n```bash\ngit clone git@github.com:shawn-mcginty/naboris-re-scaffold.git\ncd naboris-re-scaffold\nnpm run install\nnpm run build\nnpm run start\n```\n\nFor a basic OCaml project\n```bash\ngit clone git@github.com:shawn-mcginty/naboris-ml-scaffold.git\ncd naboris-ml-scaffold\nnpm run install\nnpm run build\nnpm run start\n```\n\n## Development\nAny help would be greatly appreciated! 👍\n\n### To run tests\n\n```bash\nesy install\nnpm run test\n```\n[docs html index]: https://shawn-mcginty.github.io/naboris/docs/html/index.html\n\n## Breaking Changes\n\n| From | To | Breaking Change |\n| --- | --- | --- |\n| `0.1.2` | `0.1.3` | `secret` argument added to all session configuration APIs. |\n| `0.1.0` | `0.1.1` | `ServerConfig.setSessionGetter` changed to `ServerConfig.setSessionConfig` which also allows `~maxAge` and `~sidKey` to be passed in optionally. |\n| `0.1.0` | `0.1.1` | All `RequestHandler.t` and `Middleware.t` now return `Lwt.t(Res.t)` instead of `Lwt.t(unit)` |\n| `0.1.0` | `0.1.1` | `Res.reportError` now taxes `exn` as the first argument to match more closely the rest of the `Res` API. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawn-mcginty%2Fnaboris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshawn-mcginty%2Fnaboris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawn-mcginty%2Fnaboris/lists"}