{"id":25866166,"url":"https://github.com/rexyai/restrserve","last_synced_at":"2025-05-15T05:03:28.476Z","repository":{"id":29994034,"uuid":"114363953","full_name":"rexyai/RestRserve","owner":"rexyai","description":"R web API framework for building high-performance microservices and app backends","archived":false,"fork":false,"pushed_at":"2025-03-21T01:44:35.000Z","size":3863,"stargazers_count":283,"open_issues_count":11,"forks_count":33,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-06T08:34:24.134Z","etag":null,"topics":["http-server","openapi","r","rest-api","swagger-ui"],"latest_commit_sha":null,"homepage":"https://restrserve.org","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rexyai.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-15T11:35:02.000Z","updated_at":"2025-03-22T10:42:25.000Z","dependencies_parsed_at":"2025-03-27T19:12:53.316Z","dependency_job_id":"6c072348-4684-42b5-aaf2-ee168a3ec0e4","html_url":"https://github.com/rexyai/RestRserve","commit_stats":{"total_commits":523,"total_committers":8,"mean_commits":65.375,"dds":"0.34990439770554493","last_synced_commit":"2f84b697d1d0827340234b25167e75f519b1a013"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rexyai%2FRestRserve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rexyai%2FRestRserve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rexyai%2FRestRserve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rexyai%2FRestRserve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rexyai","download_url":"https://codeload.github.com/rexyai/RestRserve/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248388156,"owners_count":21095351,"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-server","openapi","r","rest-api","swagger-ui"],"created_at":"2025-03-02T02:21:59.547Z","updated_at":"2025-04-11T11:46:39.181Z","avatar_url":"https://github.com/rexyai.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RestRserve \u003ca href='https://restrserve.org'\u003e\u003cimg src='man/figures/logo.png' align=\"right\" height=\"128\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![R build status](https://github.com/rexyai/RestRserve/workflows/R-CMD-check/badge.svg)](https://github.com/rexyai/RestRserve/actions)\n\u003ca href=\"https://rexy.ai\"\u003e\u003cimg src=\"https://s3-eu-west-1.amazonaws.com/rexy.ai/images/favicon.ico\" height=\"32\" width=\"32\"\u003e\u003c/a\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/RestRserve)](https://cran.r-project.org/package=RestRserve)\n[![codecov](https://codecov.io/gh/rexyai/RestRserve/branch/master/graph/badge.svg)](https://app.codecov.io/gh/rexyai/RestRserve/branch/master)\n[![License](https://eddelbuettel.github.io/badges/GPL2+.svg)](http://www.gnu.org/licenses/gpl-2.0.html)\n[![Lifecycle: stable](https://lifecycle.r-lib.org/articles/figures/lifecycle-stable.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n[![gitter](https://img.shields.io/gitter/room/RestRserve/community.svg?color=61D6AD\u0026style=popout)](https://app.gitter.im/#/room/#RestRserve_community:gitter.im)\n![tinyverse](https://tinyverse.netlify.com/badge/RestRserve)\n\u003c!-- badges: end --\u003e\n\n[RestRserve](https://github.com/rexyai/RestRserve) is an R web API framework for building **high-performance** AND **robust** microservices and app backends. On UNIX-like systems and [Rserve](https://github.com/s-u/Rserve) backend RestRserve handles requests in parallel: each request in a separate fork - credits go to [Simon Urbanek](https://github.com/s-u).\n\n## Quick start\n\nCreating application is as simple as:\n```r\nlibrary(RestRserve)\napp = Application$new()\n\napp$add_get(\n  path = \"/health\", \n  FUN = function(.req, .res) {\n    .res$set_body(\"OK\")\n  })\n\napp$add_post(\n  path = \"/addone\", \n  FUN = function(.req, .res) {\n    result = list(x = .req$body$x + 1L)\n    .res$set_content_type(\"application/json\")\n    .res$set_body(result)\n  })\n\n\nbackend = BackendRserve$new()\nbackend$start(app, http_port = 8080)\n```\n\nTest it with `curl`:\n\n```sh\ncurl localhost:8080/health\n# OK\ncurl -H \"Content-Type: application/json\" -d '{\"x\":10}' localhost:8080/addone\n# {\"x\":11}\n```\n### Autocomplete\n\nUsing convenient `.req`, `.res` names for handler arguments allows to leverage autocomplete.\n\n\u003cimg src=\"https://s3.eu-west-1.amazonaws.com/cdn.rexy.ai/assets/req-res.gif\" width=\"640\" style=\"vertical-align:bottom\"\u003e\n\n## Learn RestRserve\n\n- follow [quick start guide on http://restrserve.org/](https://restrserve.org/articles/RestRserve.html) for more details.\n- see \"Articles\" section on https://restrserve.org/\n- check out [examples on https://github.com/rexyai/RestRserve](https://github.com/rexyai/RestRserve/tree/master/inst/examples)\n\n## Features\n\n- Stable, easy to install, few dependencies\n- Concise and intuitive syntax\n- Well documented, comes with **many examples** - see [inst/examples](https://github.com/rexyai/RestRserve/tree/master/inst/examples)\n- Fully featured http server with the **support for URL encoded and multipart forms**\n- Build **safe and secure applications** - RestRserve supports *https*, provides building blocks for basic/token authentication\n- **Raise meaningful http errors** and allows to interrupt request handling from any place of the user code\n- Saves you from boilerplate code:\n  - automatically decodes request body from the common formats\n  - automatically encodes response body to the common formats\n  - automatically parses URI templates (such as `/get/{item_id}`)\n  - helps to expose OpenAPI and Swagger/Redoc/Rapidoc UI\n- It is [fast](https://restrserve.org/articles/benchmarks/Benchmarks.html)!\n\n![](https://github.com/rexyai/RestRserve/blob/master/vignettes/img/bench-rps.png?raw=true)\n\n## Installation\n\n### From CRAN\n```r\ninstall.packages(\"RestRserve\", repos = \"https://cloud.r-project.org\")\n```\n\n### Docker\n\nDebian and Alpine based images are available on docker-hub  -[https://hub.docker.com/r/rexyai/restrserve/](https://hub.docker.com/r/rexyai/restrserve/)\n\n```sh\ndocker pull rexyai/restrserve\n```\n\nYou can also install specific version (and we encourage to do so):\n\n```sh\ndocker pull rexyai/restrserve:1.2.0-alpine\n```\n\n## Contributing\n\nGuidelines for filing issues / pull requests - [CONTRIBUTING.md](https://github.com/rexyai/RestRserve/blob/master/CONTRIBUTING.md).\n\n## Acknowledgements\n\n- [Simon Urbanek](https://github.com/s-u/) (@s-u) for awesome [Rserve](https://github.com/s-u/Rserve) and all the work on R itself and on his other packages\n- [Jeff Allen](https://github.com/trestletech) (@trestletech) for his work on Swagger UI in [plumber](https://github.com/rstudio/plumber) (from where we took inspiration for our implementation)\n- [Brodie Gaslam](https://github.com/brodieG) (@brodieG) for help with understanding on how to get traceback from try-catch function calls. Also thanks [Hadley Wickham](https://github.com/hadley) (@hadley) for `evaluate::try_capture_stack` function which we use for this purpose.\n\n## Known limitations\n\n- RestRserve is primarily tested on UNIX systems. While it works natively on Windows please don't expect it to be as performant as on UNIX-like systems. If you really want to use it on Windows - consider to use [Windows Subsystem for Linux](https://blog.jdblischak.com/posts/wsl-r/).\n- Keep in mind that every request is handled in a separate process (fork from a parent R session). While this feature allows to handle requests in parallel it also restricts reuse of certain objects which are not fork-safe (notably database connections, rJava objects, etc)\n\n## Related projects\n\n- [Rook](https://github.com/jeffreyhorner/Rook)\n- [FastRWeb](https://CRAN.R-project.org/package=FastRWeb)\n- [opencpu](https://www.opencpu.org/)\n- [plumber](https://www.rplumber.io/)\n- [fiery](https://github.com/thomasp85/fiery)\n- [jug](https://github.com/Bart6114/jug) (development discontinued)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frexyai%2Frestrserve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frexyai%2Frestrserve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frexyai%2Frestrserve/lists"}