A fork to distribute the DuckDB-Wasm HTML/JS demo as an R package, serving static files via Go HTTP server (goserveR). We shall use this setup along with plumber2/Shiny/Ambiorix to build interactive web apps with DuckDB-Wasm and serve authenticated static files uri. This can be used as a poorman's MotherDuck i.e doing some computation on the server side and finishing it off on the client side with DuckDB-Wasm (serializing server computation with plumber2 nanoparquet serializer or make your own serializer).
remotes::install_github("sounkou-bioinfo/duckdb-wasm-html-js-simple")
library(duckdbWasmHtmlJsSimple)
library(goserveR)
static_dir <- system.file("static", package = "duckdbWasmHtmlJsSimple")
server(static_dir = static_dir)
inst/static in the current directory at 127.0.0.1:8081/static/
mtcars.csv in inst/static and deletes it on exit
server()Serve static files from inst/static using Go HTTP server via goserveR.
Arguments:
static_dir: Directory to serve (default: inst/static in current working directory)goserver_addr: Address to bind the server (default: 127.0.0.1:8081)prefix: URL prefix for served files (default: /static)Details:
mtcars.csv in the static directorymtcars.csv on exitMIT