Install Mosaic
Mosaic is Amalgame's web framework — one binary, N sites, HTTPS with Let's Encrypt certificates via native ACME, sessions, auth, reverse proxy.
First install the amc compiler, then add the framework packages:
amc package add web net-http tls # framework + HTTP/1.1 + TLS amc package add net-proxy # (optional) reverse proxy
A minimal server:
namespace App
import Amalgame.Web
public class Program {
public static void Main(string[] args) {
WebApp.New()
.Get("/", ctx => HttpResponse.New().Html("<h1>Hello Mosaic</h1>"))
.ServeHttps(443, "/etc/ssl/cert.pem", "/etc/ssl/key.pem")
}
}
The optional mosaic tool creates a project, generates routes from app/ and restarts the server on every save:
curl -sSL https://raw.githubusercontent.com/amalgame-lang/mosaic/main/install.sh | bash mosaic new my-app cd my-app mosaic dev # http://localhost:3000
Full reference: the Mosaic docs. Package versions: amc package versions web.