Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbixon13/mario
Implementing REST APIs through R Plumber
https://github.com/jbixon13/mario
docker heroku plumber plumber-api r rest-api
Last synced: 3 months ago
JSON representation
Implementing REST APIs through R Plumber
- Host: GitHub
- URL: https://github.com/jbixon13/mario
- Owner: jbixon13
- Created: 2020-01-30T02:04:21.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-07T22:20:15.000Z (over 4 years ago)
- Last Synced: 2024-06-05T01:48:10.656Z (5 months ago)
- Topics: docker, heroku, plumber, plumber-api, r, rest-api
- Language: R
- Homepage: http://mario-plumber.herokuapp.com/hello/world
- Size: 1020 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - jbixon13/mario - Implementing REST APIs through R Plumber (R)
README
# maRio
[![Build Status](https://travis-ci.org/jbixon13/mario.svg?branch=master)](https://travis-ci.org/jbixon13/mario)* I want to use `R` to its advantages (data manipulation, modeling, viz, etc.) and then host my work on a website.
* I want to do this without recreating my work in `JS` plotting libraries.
* `Plumber` can be used to create REST API endpoints out of `R` objects/functions to be called from my website.## API Configuration
* This API will be hosted as a single backend service for all of my projects
* It is necessary to programmatically set up `Plumber` as a [mounted router](https://www.rplumber.io/docs/programmatic-usage.html#mount-static) due to all the different endpoints to manage```sh
mario
| plumber.R (root router)
|
|└──project_1
| │ plot.R (endpoints defined here)
|
|└──project_2
| │ plot.R (endpoints defined here)
```## Hosting
* `Plumber` has integrations with DigitalOcean but building a `Docker` image allows for more flexibility in hosting options
* Heroku is free (with caveats) so I have Dockerized the API, hosted it as a Heroku app, & integrated it into my [Express app](https://github.com/jbixon13/nodeblog)
* `Travis CI` is then set up to automatically re-build the hosted API whenever I push changes to the master branch