Skip to content

Commit

Permalink
Initial commit for example
Browse files Browse the repository at this point in the history
  • Loading branch information
andyquinterom committed Jul 4, 2024
0 parents commit e88cfc4
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# faucet router example

## Install

Install the development version of faucet:

```sh
cargo install --git "https://github.com/ixpantia/faucet.git"
```

Install Shiny:

```R
install.packages("shiny")
```

## Run the router

```sh
faucet router
```

## Visit the routes

- [http://localhost:3838](http://localhost:3838)
- [http://localhost:3838/text/](http://localhost:3838/text/)
- [http://localhost:3838/sliders/](http://localhost:3838/sliders/)

1 change: 1 addition & 0 deletions app.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shiny::runExample("01_hello")
25 changes: 25 additions & 0 deletions frouter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# In this route we use `workdir` to start the child
# R session on a different working directory.
[[route]]
route = "/sliders/"
workers = 1
server_type = "Shiny"
workdir = "./sliders"

# In this route we use `app_dir` to start the R session
# in the current working directory but use an app in
# a directory.
[[route]]
route = "/text/"
workers = 1
server_type = "Shiny"
app_dir = "./text"

# By default the `workdir` and `app_dir`
# is `.` (Here). If we don't specify
# it runs the app in the current dir.
[[route]]
route = "/"
workers = 1
server_type = "Shiny"

2 changes: 2 additions & 0 deletions sliders/app.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

shiny::runExample("05_sliders")
1 change: 1 addition & 0 deletions text/app.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shiny::runExample("02_text")

0 comments on commit e88cfc4

Please sign in to comment.