{"id":13858093,"url":"https://github.com/alexvpickering/handlr","last_synced_at":"2025-10-14T07:44:07.464Z","repository":{"id":199887558,"uuid":"117298067","full_name":"alexvpickering/handlr","owner":"alexvpickering","description":"R as a backend for web apps.","archived":false,"fork":false,"pushed_at":"2018-03-07T20:35:53.000Z","size":36,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-13T23:38:29.933Z","etag":null,"topics":["opencpu","r","rapache","shiny"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexvpickering.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,"governance":null}},"created_at":"2018-01-12T23:34:33.000Z","updated_at":"2021-08-24T14:55:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"bebb0a33-15c6-4554-bb3c-01ba023c4bd9","html_url":"https://github.com/alexvpickering/handlr","commit_stats":null,"previous_names":["alexvpickering/handlr"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexvpickering/handlr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexvpickering%2Fhandlr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexvpickering%2Fhandlr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexvpickering%2Fhandlr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexvpickering%2Fhandlr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexvpickering","download_url":"https://codeload.github.com/alexvpickering/handlr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexvpickering%2Fhandlr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018214,"owners_count":26086308,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["opencpu","r","rapache","shiny"],"created_at":"2024-08-05T03:01:56.477Z","updated_at":"2025-10-14T07:44:07.433Z","avatar_url":"https://github.com/alexvpickering.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"# handlr\n\n`handlr` makes R functions available as API endpoints. It is the less opinionated cousin of [OpenCPU](https://github.com/opencpu/opencpu).\n\n\n\n#### Shared Features with OpenCPU\n\n* Built on Apache2 and rApache\n* Each request handled in seperate R fork \n* Borrows code e.g. for parsing http requests\n\n\n\n#### Distinguishing Features\n\n* Doesn't expose your R code through GET requests\n* You decide what R functions can be run\n* Easy user management with [`authr`](https://github.com/alexvpickering/authr)\n\n\n# Getting Started\n\nAssumes Ubuntu 16.04. See the [wiki](https://github.com/alexvpickering/handlr/wiki) for a more thorough intro and [`authr`](https://github.com/alexvpickering/authr) for user management.\n\nInstall Apache2, rApache, and create an `entry.R` file that rApache will run:\n\n```\nsudo apt update\nsudo apt install apache2 -y\n\nsudo add-apt-repository ppa:opencpu/rapache -y\nsudo apt-get update\nsudo apt-get install libapache2-mod-r-base -y\n\nsudo mkdir /var/www/R\nsudo touch /var/www/R/entry.R\nsudo vi /var/www/R/entry.R\n```\n\nType `i` to insert then paste the following:\n\n```R\nsetHeader(header = \"X-Powered-By\", value = \"rApache\")\n\n# functions exported by 'packages' can be used as endpoints\npackages \u003c- c('your_package')\n\nhandlr::handle(SERVER, GET, packages)\n```\nSave (type `esc:wq` then hit enter). Now create an example Apache2 site that will run `entry.R` for incomming http requests:\n\n```\nsudo touch /etc/apache2/sites-available/example.conf\nsudo vi /etc/apache2/sites-available/example.conf\n```\n\nType `i` to insert, then paste the following:\n\n```apache\nLoadModule R_module /usr/lib/apache2/modules/mod_R.so\n\n\u003cLocation /api\u003e\n\tSetHandler r-handler\n\tRFileHandler /var/www/R/entry.R\n\u003c/Location\u003e\n```\n\nEnable the example site:\n\n```\nsudo a2ensite example\nsudo service apache2 reload\n```\n\nSave and exit as before. Install `handlr` and `your_package`, making sure they will be available to the `www-data` user that Apache2 runs under:\n\n```R\n# devtools dependencies\nsudo apt install libssl-dev \nsudo apt install libcurl4-openssl-dev\n\nsudo R\n.libPaths('/usr/local/lib/R/site-library')\n\ninstall.packages('sys', configure.vars = 'NO_APPARMOR=1')\ninstall.packages('devtools')\n\ndevtools::install_github(c('alexvpickering/handlr', 'your_github_username/your_package'))\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexvpickering%2Fhandlr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexvpickering%2Fhandlr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexvpickering%2Fhandlr/lists"}