RestRserve
R web API framework for building high-performance microservices and app backends
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.8%) to scientific vocabulary
Keywords
Repository
R web API framework for building high-performance microservices and app backends
Basic Info
- Host: GitHub
- Owner: rexyai
- Language: R
- Default Branch: master
- Homepage: https://restrserve.org
- Size: 3.68 MB
Statistics
- Stars: 291
- Watchers: 19
- Forks: 34
- Open Issues: 11
- Releases: 0
Topics
Metadata Files
README.md
RestRserve 
RestRserve is an R web API framework for building high-performance AND robust microservices and app backends. On UNIX-like systems and Rserve backend RestRserve handles requests in parallel: each request in a separate fork - credits go to Simon Urbanek.
Quick start
Creating application is as simple as: ```r library(RestRserve) app = Application$new()
app$addget( path = "/health", FUN = function(.req, .res) { .res$setbody("OK") })
app$addpost( path = "/addone", FUN = function(.req, .res) { result = list(x = .req$body$x + 1L) .res$setcontenttype("application/json") .res$setbody(result) })
backend = BackendRserve$new() backend$start(app, http_port = 8080) ```
Test it with curl:
```sh curl localhost:8080/health
OK
curl -H "Content-Type: application/json" -d '{"x":10}' localhost:8080/addone
{"x":11}
```
Autocomplete
Using convenient .req, .res names for handler arguments allows to leverage autocomplete.

Learn RestRserve
- follow quick start guide on http://restrserve.org/ for more details.
- see "Articles" section on https://restrserve.org/
- check out examples on https://github.com/rexyai/RestRserve
Features
- Stable, easy to install, few dependencies
- Concise and intuitive syntax
- Well documented, comes with many examples - see inst/examples
- Fully featured http server with the support for URL encoded and multipart forms
- Build safe and secure applications - RestRserve supports https, provides building blocks for basic/token authentication
- Raise meaningful http errors and allows to interrupt request handling from any place of the user code
- Saves you from boilerplate code:
- automatically decodes request body from the common formats
- automatically encodes response body to the common formats
- automatically parses URI templates (such as
/get/{item_id}) - helps to expose OpenAPI and Swagger/Redoc/Rapidoc UI
- It is fast!

Installation
From CRAN
r
install.packages("RestRserve", repos = "https://cloud.r-project.org")
Docker
Debian and Alpine based images are available on docker-hub -https://hub.docker.com/r/rexyai/restrserve/
sh
docker pull rexyai/restrserve
You can also install specific version (and we encourage to do so):
sh
docker pull rexyai/restrserve:1.2.0-alpine
Contributing
Guidelines for filing issues / pull requests - CONTRIBUTING.md.
Acknowledgements
- Simon Urbanek (@s-u) for awesome Rserve and all the work on R itself and on his other packages
- Jeff Allen (@trestletech) for his work on Swagger UI in plumber (from where we took inspiration for our implementation)
- Brodie Gaslam (@brodieG) for help with understanding on how to get traceback from try-catch function calls. Also thanks Hadley Wickham (@hadley) for
evaluate::try_capture_stackfunction which we use for this purpose.
Known limitations
- 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.
- 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)
Related projects
Owner
- Name: rexy.ai
- Login: rexyai
- Kind: organization
- Email: hello@rexy.ai
- Website: https://rexy.ai
- Repositories: 3
- Profile: https://github.com/rexyai
GitHub Events
Total
- Issues event: 6
- Watch event: 15
- Issue comment event: 8
- Push event: 9
- Pull request event: 4
- Fork event: 3
- Create event: 3
Last Year
- Issues event: 6
- Watch event: 15
- Issue comment event: 8
- Push event: 9
- Pull request event: 4
- Fork event: 3
- Create event: 3
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Dmitriy Selivanov | s****y@g****m | 379 |
| Artem Klevtsov | a****v@g****m | 154 |
| DavZim | d****n@h****e | 5 |
| Ryan Hafen | r****n@g****m | 2 |
| AbrJA | a****s@o****x | 2 |
| Michael Chirico | c****m@g****m | 1 |
| Jone Keat Lim | j****t@g****m | 1 |
| Jan Gorecki | j****i | 1 |
| Barret Schloerke | b****t@r****m | 1 |
| Alassane Samba | a****a@o****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 77
- Total pull requests: 40
- Average time to close issues: about 1 month
- Average time to close pull requests: 12 days
- Total issue authors: 45
- Total pull request authors: 10
- Average comments per issue: 3.75
- Average comments per pull request: 2.33
- Merged pull requests: 40
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 3
- Pull requests: 2
- Average time to close issues: 4 months
- Average time to close pull requests: 2 days
- Issue authors: 3
- Pull request authors: 2
- Average comments per issue: 0.67
- Average comments per pull request: 1.5
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- dselivanov (12)
- richarddmorey (4)
- hongooi73 (3)
- rplati (3)
- mattjvincent (3)
- vikram-rawat (3)
- longhua8800w (3)
- mentik (2)
- DavZim (2)
- AbrJA (2)
- andreas-ullrich (2)
- Tartomas (2)
- mrchypark (2)
- sambaala (2)
- rdatasculptor (2)
Pull Request Authors
- dselivanov (20)
- artemklevtsov (9)
- DavZim (5)
- yihui (2)
- AbrJA (2)
- hafen (2)
- MichaelChirico (2)
- jonekeat (1)
- schloerke (1)
- sambaala (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- cran 536 last-month
- Total docker downloads: 20,358
-
Total dependent packages: 2
(may contain duplicates) -
Total dependent repositories: 20
(may contain duplicates) - Total versions: 46
- Total maintainers: 1
proxy.golang.org: github.com/rexyai/restrserve
- Documentation: https://pkg.go.dev/github.com/rexyai/restrserve#section-documentation
-
Latest release: v1.2.4
published 11 months ago
Rankings
proxy.golang.org: github.com/rexyai/RestRserve
- Documentation: https://pkg.go.dev/github.com/rexyai/RestRserve#section-documentation
-
Latest release: v1.2.4
published 11 months ago
Rankings
cran.r-project.org: RestRserve
A Framework for Building HTTP API
- Homepage: https://restrserve.org
- Documentation: http://cran.r-project.org/web/packages/RestRserve/RestRserve.pdf
- License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
-
Latest release: 1.2.4
published 11 months ago
Rankings
Maintainers (1)
Dependencies
- R >= 3.6.0 depends
- R6 >= 2.4.0 imports
- Rcpp >= 1.0.3 imports
- Rserve >= 1.7.3 imports
- checkmate >= 1.9.4 imports
- digest >= 0.6.29 imports
- jsonlite >= 1.6 imports
- methods * imports
- mime >= 0.7 imports
- parallel * imports
- uuid >= 0.1 imports
- curl * suggests
- knitr * suggests
- lgr >= 0.3.2 suggests
- lintr * suggests
- rmarkdown * suggests
- sys * suggests
- tinytest >= 1.0.0 suggests
- actions/cache v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc master composite
- r-lib/actions/setup-r master composite
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/upload-artifact main composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
- actions/checkout v2 composite
- docker/build-push-action v3 composite
- docker/login-action v2 composite
- docker/metadata-action v4 composite
- actions/cache v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
- r-base 4.2.0 build