servr

A simple HTTP server in R

https://github.com/yihui/servr

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.5%) to scientific vocabulary

Keywords

http-server r r-package web-server websocket

Keywords from Contributors

pandoc rmarkdown literate-programming shiny gitbook epub latex bookdown book report
Last synced: 6 months ago · JSON representation

Repository

A simple HTTP server in R

Basic Info
Statistics
  • Stars: 287
  • Watchers: 18
  • Forks: 35
  • Open Issues: 7
  • Releases: 33
Topics
http-server r r-package web-server websocket
Created over 12 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog Contributing Funding Code of conduct

README.md

servr

R-CMD-check CRAN release <!-- badges: end -->

A simple HTTP server to serve files under a given directory based on the httpuv package.

You can install this package from CRAN (stable version) via install.packages('servr') or r-universe.dev (development version).

This package is licensed under GPL.

Serve static files

To some degree, this package is like python -m SimpleHTTPServer or python -m http.server. It may be used to serve:

You can either run servr::httd() in an interactive R session, or run from command line:

```bash

default: port 4321, do not launch browser

Rscript -e "servr::httd()"

open a web browser

Rscript -e "servr::httd()" -b

listen on port 4000

Rscript -e "servr::httd()" -p4000

pass arguments to the httd() function

Rscript -e "servr::httd(,4000,TRUE)" ```

There is also a shell script under system.file('bin', package = 'servr'); if it is added to PATH, you can simply run

bash servr # serve the current directory servr -b # launch the browser servr -b -p4000 # change port to 4000

Serve and watch a directory

Similar to httd(), the function httw() can both serve and watch a directory. If you are viewing an HTML file in the browser, it will be automatically refreshed whenever there are any changes in the directory (e.g. you added, deleted, or modified certain files in the directory).

Serve dynamic documents

Besides httd(), there are functions jekyll(), rmdv1(), and rmdv2() in this package to serve HTML files generated from R Markdown documents (via knitr or rmarkdown). R Markdown documents can be automatically re-compiled when their HTML output files are older than the corresponding source files, and HTML pages in the web browser can be automatically refreshed accordingly, so you can focus on writing R Markdown documents, and results will be updated on the fly in the web browser. This is even more useful when you write R Markdown documents in the RStudio IDE, because the HTML files are displayed in the RStudio viewer pane, and you can put the source document and its output side by side.

Jekyll with servr and knitr

Serve package vignettes

The function vign() can be used to serve R Markdown/HTML package vignettes. The HTML output files are generated and displayed in the web browser so you can preview the vignettes, and they will be cleaned up after they are loaded in the web browser to make sure your source package is clean.

Daemonized server

All server functions can be used in the daemonized mode, i.e., they can be non-blocking in the R session, which allows you to continue working in the R console after the server is launched. This mode can be set via the argument daemon = TRUE in most server functions. See ?server_config for more information.

Owner

  • Name: Yihui Xie
  • Login: yihui
  • Kind: user
  • Location: Omaha, NE
  • Company: @rstudio @swissre @merck

Freelancer (open source programmer, contractor, blogger, and writer)

GitHub Events

Total
  • Watch event: 10
  • Push event: 3
Last Year
  • Watch event: 10
  • Push event: 3

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 406
  • Total Committers: 13
  • Avg Commits per committer: 31.231
  • Development Distribution Score (DDS): 0.047
Past Year
  • Commits: 16
  • Committers: 3
  • Avg Commits per committer: 5.333
  • Development Distribution Score (DDS): 0.125
Top Committers
Name Email Commits
Yihui Xie x****e@y****e 387
Carson Sievert c****1@g****m 5
Christophe Dervieux c****x@g****m 4
Romain Lesur R****r 1
Ricardo Wurmus r****s@m****e 1
Ramnath Vaidyanathan r****a@g****m 1
Marcin Kosiński m****i@g****m 1
Magnus Thor Torfason m@z****t 1
Jesse Anderson j****n@g****m 1
Jason Punyon j****n@g****m 1
Ihaddaden Mohamed El Fodil i****l@g****m 1
Florian Kohrt f****t@a****o 1
Ben Raymond b****n@t****g 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 46
  • Total pull requests: 20
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 19 days
  • Total issue authors: 33
  • Total pull request authors: 15
  • Average comments per issue: 2.93
  • Average comments per pull request: 1.0
  • Merged pull requests: 15
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • hadley (5)
  • itcarroll (4)
  • statquant (3)
  • cboettig (3)
  • cpsievert (2)
  • jessjaco (2)
  • yihui (1)
  • jayleverett (1)
  • karagawa (1)
  • pythiantech (1)
  • JasonPunyon (1)
  • msgc (1)
  • lsundnli (1)
  • stevecondylios (1)
  • melindahiggins2000 (1)
Pull Request Authors
  • cpsievert (4)
  • fkohrt (2)
  • torfason (2)
  • jessjaco (2)
  • cderv (2)
  • feddelegrand7 (1)
  • raymondben (1)
  • JasonPunyon (1)
  • rekado (1)
  • ARawles (1)
  • ColinFay (1)
  • mentik (1)
  • MarcinKosinski (1)
  • ramnathv (1)
  • RLesur (1)
Top Labels
Issue Labels
enhancement (4) bug (2) question (1)
Pull Request Labels

Packages

  • Total packages: 3
  • Total downloads:
    • cran 39,440 last-month
  • Total docker downloads: 2,439,879
  • Total dependent packages: 27
    (may contain duplicates)
  • Total dependent repositories: 154
    (may contain duplicates)
  • Total versions: 48
  • Total maintainers: 1
cran.r-project.org: servr

A Simple HTTP Server to Serve Static Files or Dynamic Documents

  • Versions: 33
  • Dependent Packages: 22
  • Dependent Repositories: 152
  • Downloads: 39,440 Last month
  • Docker Downloads: 2,439,879
Rankings
Docker downloads count: 0.0%
Stargazers count: 1.6%
Dependent repos count: 1.6%
Average: 1.8%
Downloads: 2.0%
Forks count: 2.2%
Dependent packages count: 3.3%
Maintainers (1)
Last synced: 6 months ago
proxy.golang.org: github.com/yihui/servr
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
conda-forge.org: r-servr
  • Versions: 14
  • Dependent Packages: 5
  • Dependent Repositories: 2
Rankings
Dependent packages count: 10.4%
Dependent repos count: 20.1%
Average: 20.8%
Stargazers count: 23.7%
Forks count: 29.1%
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.0.0 depends
  • httpuv >= 1.5.2 imports
  • jsonlite * imports
  • mime >= 0.2 imports
  • xfun * imports
  • knitr >= 1.9 suggests
  • later * suggests
  • rmarkdown * suggests
  • rstudioapi * suggests
  • tools * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout HEAD composite
  • r-lib/actions/check-r-package HEAD composite
  • r-lib/actions/setup-r HEAD composite
  • r-lib/actions/setup-r-dependencies HEAD composite