Skip to content

ambiorix-web/alesia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alesia

HTML minifier middleware for ambiorix.

Installation

# install.packages("remotes")
remotes::install_github("devOpifex/alesia")

Example

Simply add the middleware, it will minify the output of the send_file and render functions, see man page ?alesia for options.

library(alesia)
library(ambiorix)

app <- Ambiorix$new()

app$use(alesia())

app$get("/", \(req, res){
  res$render(
    "home",
    data = list(
      string = "Hello world!"
    )
  )
})

app$start()