Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docs #1

Open
3 of 6 tasks
kennedymwavu opened this issue Jan 4, 2025 · 4 comments
Open
3 of 6 tasks

update docs #1

kennedymwavu opened this issue Jan 4, 2025 · 4 comments
Assignees

Comments

@kennedymwavu
Copy link
Collaborator

kennedymwavu commented Jan 4, 2025

there are several sections that need to be updated:

new sections:

@kennedymwavu
Copy link
Collaborator Author

nginx distributes traffic to the services/containers spawned by docker compose

supported load distribution methods:

  • round-robin: sequential
  • least-connected: requests are sent to the container with the fewest active connections
  • ip-hash: routes requests from the same IP address to the same container for session persistence

@kennedymwavu
Copy link
Collaborator Author

  • no need for explicit html templates, reference

@kennedymwavu
Copy link
Collaborator Author

  • how to set global pre & post-render hooks, reference

@kennedymwavu kennedymwavu self-assigned this Jan 21, 2025
@kennedymwavu
Copy link
Collaborator Author

  • how to set multiple static directories

with this file structure:

.
├── another
│   └── the-ring.jpeg
├── index.R
└── public
    └── gollum.jpeg

you can:

library(ambiorix)
library(htmltools)

home_get <- \(req, res){
  html <- tagList(
    tags$h3("One ring to rule them all"),
    tags$img(src = "/assets2/the-ring.jpeg", alt = "the one ring")
  )

  res$send(html)
}

about_get <- \(req, res) {
  html <- tagList(
    tags$h3("My precious!"),
    tags$img(src = "assets/gollum.jpeg")
  )

  res$send(html)
}

Ambiorix$new()$
  static("public", "assets")$
  static("another", "assets2")$
  get("/", home_get)$
  get("/about", about_get)$
  start()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant