All Projects → rexyai → Restrserve

rexyai / Restrserve

R web API framework for building high-performance microservices and app backends

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Restrserve

Flasgger
Easy OpenAPI specs and Swagger UI for your Flask API
Stars: ✭ 2,825 (+1264.73%)
Mutual labels:  rest-api, openapi, swagger-ui
Go Book Store Api
Go Sample project to understand Mysql CRUD operation with best practises Includes logging, JWT, Swagger and Transactions
Stars: ✭ 18 (-91.3%)
Mutual labels:  rest-api, swagger-ui, http-server
Swagger Ui
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
Stars: ✭ 21,279 (+10179.71%)
Mutual labels:  rest-api, openapi, swagger-ui
Drf Yasg
Automated generation of real Swagger/OpenAPI 2.0 schemas from Django REST Framework code.
Stars: ✭ 2,523 (+1118.84%)
Mutual labels:  rest-api, openapi, swagger-ui
Django Ninja
💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
Stars: ✭ 875 (+322.71%)
Mutual labels:  rest-api, openapi, swagger-ui
Springdoc Openapi
Library for OpenAPI 3 with spring-boot
Stars: ✭ 1,113 (+437.68%)
Mutual labels:  rest-api, openapi, swagger-ui
Watsonwebserver
Watson is the fastest, easiest way to build scalable RESTful web servers and services in C#.
Stars: ✭ 125 (-39.61%)
Mutual labels:  rest-api, http-server
Grpc Gateway
The gRPC-Gateway is a plugin of the Google protocol buffers compiler protoc. It reads protobuf service definitions and generates a reverse-proxy server which translates a RESTful HTTP API into gRPC. This server is generated according to the google.api.http annotations in your service definitions.
Stars: ✭ 12,223 (+5804.83%)
Mutual labels:  rest-api, openapi
Tsed
📐 Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline to make your code more readable and less error-prone.
Stars: ✭ 1,941 (+837.68%)
Mutual labels:  rest-api, swagger-ui
Gemini
Model Driven REST framework to automatically generate CRUD APIs
Stars: ✭ 138 (-33.33%)
Mutual labels:  rest-api, openapi
Json Serverless
Transform a JSON file into a serverless REST API in AWS cloud
Stars: ✭ 108 (-47.83%)
Mutual labels:  rest-api, swagger-ui
Angular Swagger Ui
An angularJS implementation of Swagger UI
Stars: ✭ 131 (-36.71%)
Mutual labels:  openapi, swagger-ui
Openapi Directory
🌐 Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format
Stars: ✭ 2,635 (+1172.95%)
Mutual labels:  rest-api, openapi
Openapi Cli Generator
Generate a CLI from an OpenAPI 3 specification
Stars: ✭ 121 (-41.55%)
Mutual labels:  rest-api, openapi
L5 Swagger
OpenApi or Swagger integration to Laravel
Stars: ✭ 1,781 (+760.39%)
Mutual labels:  openapi, swagger-ui
Openapi Python Client
Generate modern Python clients from OpenAPI
Stars: ✭ 126 (-39.13%)
Mutual labels:  rest-api, openapi
Pretty Swag
Pretty UI for Swagger spec
Stars: ✭ 112 (-45.89%)
Mutual labels:  rest-api, swagger-ui
Rapipdf
PDF generation from OpenAPI / Swagger Spec
Stars: ✭ 132 (-36.23%)
Mutual labels:  openapi, swagger-ui
Hikaku
A library that tests if the implementation of a REST-API meets its specification.
Stars: ✭ 154 (-25.6%)
Mutual labels:  rest-api, openapi
Swagger meqa
Auto generate and run tests using swagger/OpenAPI spec, no coding needed
Stars: ✭ 151 (-27.05%)
Mutual labels:  rest-api, openapi

RestRserve

R build status CRAN status codecov License Lifecycle: maturing gitter tinyverse

RestRserve is an R web API framework for building high-performance AND robust microservices and app backends. With Rserve backend on UNIX-like systems it is parallel by design. It will handle incoming requests in parallel - each request in a separate fork (all the credits should go to Simon Urbanek).

Quick start

Creating application is as simple as:

library(RestRserve)
app = Application$new()

app$add_get(
  path = "/health", 
  FUN = function(.req, .res) {
    .res$set_body("OK")
  })

app$add_post(
  path = "/addone", 
  FUN = function(.req, .res) {
    result = list(x = .req$body$x + 1L)
    .res$set_content_type("application/json")
    .res$set_body(result)
  })


backend = BackendRserve$new()
backend$start(app, http_port = 8080)

Test it with curl:

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

Features

  • Stable, easy to install, small number of dependencies
  • 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
  • Concise and intuitive syntax
  • Raise meaningful http errors and allows to interrupt request handling from any place of the user code
  • Well documented, comes with many examples - see inst/examples
  • 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

install.packages("RestRserve", repos = "https://cloud.r-project.org")

Docker

Debian and Alpine based images are available from docker-hub: https://hub.docker.com/r/rexyai/restrserve/

docker pull rexyai/restrserve

Or install specific version:

docker pull rexyai/restrserve:0.4.0-minimal

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_stack function 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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].