{"id":14068394,"url":"https://github.com/yihui/servr","last_synced_at":"2025-10-05T20:51:44.963Z","repository":{"id":47954652,"uuid":"12801644","full_name":"yihui/servr","owner":"yihui","description":"A simple HTTP server in R","archived":false,"fork":false,"pushed_at":"2025-01-10T22:57:16.000Z","size":526,"stargazers_count":288,"open_issues_count":7,"forks_count":35,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-09-08T14:23:01.843Z","etag":null,"topics":["http-server","r","r-package","web-server","websocket"],"latest_commit_sha":null,"homepage":"https://git.yihui.org/servr/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yihui.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":null,"code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["yihui"],"patreon":null,"custom":null}},"created_at":"2013-09-13T04:43:46.000Z","updated_at":"2025-09-08T01:36:45.000Z","dependencies_parsed_at":"2023-02-07T16:16:03.969Z","dependency_job_id":"7b3218af-1e65-433c-9d39-4a99a517b21a","html_url":"https://github.com/yihui/servr","commit_stats":{"total_commits":403,"total_committers":13,"mean_commits":31.0,"dds":0.04714640198511166,"last_synced_commit":"368365736323814dc7ac76ecf39548f0b069413e"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/yihui/servr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihui%2Fservr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihui%2Fservr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihui%2Fservr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihui%2Fservr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yihui","download_url":"https://codeload.github.com/yihui/servr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihui%2Fservr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278518886,"owners_count":26000177,"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-05T02:00:06.059Z","response_time":54,"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":["http-server","r","r-package","web-server","websocket"],"created_at":"2024-08-13T07:06:08.531Z","updated_at":"2025-10-05T20:51:44.942Z","avatar_url":"https://github.com/yihui.png","language":"R","funding_links":["https://github.com/sponsors/yihui"],"categories":["R"],"sub_categories":[],"readme":"# servr\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/yihui/servr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/yihui/servr/actions/workflows/R-CMD-check.yaml)\n[![CRAN release](https://www.r-pkg.org/badges/version/servr)](https://cran.r-project.org/package=servr)\n\u003c!-- badges: end --\u003e\n\n\nA simple HTTP server to serve files under a given directory based on the\n[**httpuv**](https://cran.r-project.org/package=httpuv) package.\n\nYou can install this package from\n[CRAN](https://cran.r-project.org/package=servr) (stable version) via `install.packages('servr')` or\n[r-universe.dev](https://yihui.r-universe.dev) (development version).\n\nThis package is licensed under GPL.\n\n## Serve static files\n\nTo some degree, this package is like `python -m SimpleHTTPServer` or `python -m\nhttp.server`. It may be used to serve:\n\n- R Markdown applications\n    - [**bookdown**](https://github.com/rstudio/bookdown) books\n    - [**blogdown**](https://github.com/rstudio/blogdown) websites\n    - [**xaringan**](https://github.com/yihui/xaringan) presentations\n- [**googleVis**](https://cran.r-project.org/package=googleVis) charts (to avoid\n  the Flash security issue)\n- D3 charts which need to load JSON from local files (see also the\n  [**animint2**](https://github.com/tdhock/animint2) package), and\n  [**samatha**](https://github.com/DASpringate/samatha), etc\n\nYou can either run `servr::httd()` in an interactive R session, or run from\ncommand line:\n\n```bash\n# default: port 4321, do not launch browser\nRscript -e \"servr::httd()\"\n\n# open a web browser\nRscript -e \"servr::httd()\" -b\n\n# listen on port 4000\nRscript -e \"servr::httd()\" -p4000\n\n# pass arguments to the httd() function\nRscript -e \"servr::httd(,4000,TRUE)\"\n```\n\nThere is also a shell script under `system.file('bin', package = 'servr')`;\nif it is added to `PATH`, you can simply run\n\n```bash\nservr  # serve the current directory\nservr -b  # launch the browser\nservr -b -p4000  # change port to 4000\n```\n\n## Serve and watch a directory\n\nSimilar to `httd()`, the function `httw()` can both serve and watch a directory.\nIf you are viewing an HTML file in the browser, it will be automatically\nrefreshed whenever there are any changes in the directory (e.g. you added,\ndeleted, or modified certain files in the directory).\n\n## Serve dynamic documents\n\nBesides `httd()`, there are functions `jekyll()`, `rmdv1()`, and `rmdv2()` in\nthis package to serve HTML files generated from R Markdown documents (via\n[**knitr**](https://yihui.org/knitr/) or\n[**rmarkdown**](https://rmarkdown.rstudio.com)). R Markdown documents can be\nautomatically re-compiled when their HTML output files are older than the\ncorresponding source files, and HTML pages in the web browser can be\nautomatically refreshed accordingly, so you can focus on writing R Markdown\ndocuments, and results will be updated on the fly in the web browser. This is\neven more useful when you write R Markdown documents in the RStudio IDE, because\nthe HTML files are displayed in the RStudio viewer pane, and you can put the\nsource document and its output side by side.\n\n![Jekyll with servr and knitr](http://i.imgur.com/gKVGhiP.png)\n\n## Serve package vignettes\n\nThe function `vign()` can be used to serve R Markdown/HTML package vignettes.\nThe HTML output files are generated and displayed in the web browser so you can\npreview the vignettes, and they will be cleaned up after they are loaded in the\nweb browser to make sure your source package is clean.\n\n## Daemonized server\n\nAll server functions can be used in the daemonized mode, i.e., they can be\nnon-blocking in the R session, which allows you to continue working in the R\nconsole after the server is launched. This mode can be set via the argument\n`daemon = TRUE` in most server functions. See `?server_config` for more\ninformation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyihui%2Fservr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyihui%2Fservr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyihui%2Fservr/lists"}