Getting Started
Getting Started
Quick Start
Install {ambiorix}
The stable version is available on CRAN:
install.packages("ambiorix")
Alternatively, install the development version from GitHub with the {remotes} package:
remotes::install_github("ambiorix-web/ambiorix")
Create a new project
Create a directory to hold your application, and make that your working directory:
mkdir hello-world
cd hello-world
Create a new file called app.R
:
touch app.R
Hello, World
Put this in app.R
:
library(ambiorix)
app <- Ambiorix$new(port = 8000L)
app$get("/", \(req, res) {
res$send("Hello, World!")
})
app$start()
Run the app
app.R
is the entrypoint. To start the app, run this on the terminal:
Rscript app.R
Alternatively, if you’re using an IDE like Rstudio or Positron, highlight everything in app.R
and run the code.
Visit localhost/8000.
You just built your first Ambiorix app.
🎉Congratulations!🎉
Next
Let’s take a closer look at the hello world app: