{"id":13941526,"url":"https://github.com/martinv13/node-shiny-proxy","last_synced_at":"2025-04-24T16:31:39.395Z","repository":{"id":45231599,"uuid":"313083200","full_name":"martinv13/node-shiny-proxy","owner":"martinv13","description":"R Shiny apps deployment made simple","archived":false,"fork":false,"pushed_at":"2021-12-29T19:03:58.000Z","size":123,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T00:39:07.843Z","etag":null,"topics":["express-js","express-middleware","expressjs","node","node-js","nodejs","r","shiny"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/martinv13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-15T17:18:10.000Z","updated_at":"2024-05-10T17:31:18.000Z","dependencies_parsed_at":"2022-09-05T20:01:28.162Z","dependency_job_id":null,"html_url":"https://github.com/martinv13/node-shiny-proxy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinv13%2Fnode-shiny-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinv13%2Fnode-shiny-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinv13%2Fnode-shiny-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinv13%2Fnode-shiny-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martinv13","download_url":"https://codeload.github.com/martinv13/node-shiny-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250663544,"owners_count":21467366,"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":["express-js","express-middleware","expressjs","node","node-js","nodejs","r","shiny"],"created_at":"2024-08-08T02:01:20.621Z","updated_at":"2025-04-24T16:31:38.891Z","avatar_url":"https://github.com/martinv13.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# node-shiny-proxy\n\n`node-shiny-proxy` is a simple way to deploy R Shiny apps. It runs some instances of your Shiny app(s) using `Rscript` on your system and sets up a reverse proxy to expose them to your users. It relies on the popular [`http-proxy`](https://github.com/http-party/node-http-proxy) and [`http-proxy-middleware`](https://github.com/chimurai/http-proxy-middleware) for proxying. As a pure Node.js solution it is platform-independent.\n\nIt is intended mainly as a proof of concept deployment option; for more robust solution you should go to Rstudio's [Shiny Server](https://rstudio.com/products/shiny/shiny-server/) or to [ShinyProxy](https://www.shinyproxy.io/). However, depending on your needs, you may find some of its features useful:\n\n* it runs several instances of your Shiny apps to overcome the single-process limitation of the free version of Shiny Server,\n* it works cross-platform (where R and Node.js run) and does not rely on Java or Docker as ShinyProxy does,\n* it basically a middleware for a Node.js [Express](https://expressjs.com) application, so it can be extended easily to suit your needs (authentication, etc.),\n* it can host different Shiny apps at \"nested\" paths (for instance one app at `/` and another at `/some-app`).\n\n## Installation\n\n```\nnpm install --save shiny-proxy\n```\n\n## Simple example\n\nThe following example will serve two Shiny apps located in the `shiny-apps/main-app` and `shiny-apps/my-app`folders:\n\n``` javascript\n\nimport express from 'express';\nimport ShinyProxy from 'shiny-proxy';\n\nconst shinyProxy = new ShinyProxy({\n    portRangeStart: 4000,\n    apps: [\n        {\n            id: 'main-app',\n            path: '/',\n            appDir: 'shiny-apps/main-app'\n        },\n        {\n            id: 'my-app',\n            path: '/my-app',\n            appDir: 'shiny-apps/my-app'\n        }\n    ]\n});\n\nconst app = express();\n\napp.use(shinyProxy.middleware);\n\napp.listen(3000);\n\n```\n\n## Options\n\nA `shiny-proxy` object is created with `new ShinyProxy(options)`. This section described available options.\n\n#### Main settings\n\n* **options.portRangeStart:** the start of the port range to serve Shiny apps instances on `localhost` (defaults to 4000). Shiny apps instances will be served on available tcp ports starting from there.\n\n* **options.RscriptPath:** the path to `Rscript` executable (by default, `/usr/lib/R/bin/Rscript`).\n\n* **options.redirect404:** the path to redirect \"page not found\" errors to (by default, `/404`).\n\n* **options.redirect500:** the path to redirect \"internal server errors\" to (by default, `/500`). On error, `shiny-proxy` will try to launch new instance of your apps.\n\n* **options.apps:** an array of Shiny apps settings.\n\n#### Apps settings\n\n* **options.apps[i].id:** a unique string identifier for the Shiny app.\n\n* **options.apps[i].path:** the path to serve the Shiny app on.\n\n* **options.apps[i].appDir:** the path of the folder containing the Shiny app (with either `app.R` or `server.R` and `ui.R`).\n\n* **options.apps[i].workers:** the number of instances of the app to run (by default 2).\n\n## License\n\nMIT License (MIT)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinv13%2Fnode-shiny-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinv13%2Fnode-shiny-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinv13%2Fnode-shiny-proxy/lists"}