Scala handlers.
Nuxt applications.
Write Nuxt server routes as plain Scala.js functions. h34s runs them on a Kyo core, with a first-class ZIO adapter. Your services stay in your app.
Release 0.2.0-alpha.1 is an alpha on GitHub Packages. The repository demo is optional.
Your application handler
@JSExportTopLevel("default", "kyo-greeting-post")
val personalizedGreeting: EventHandler = AppHandler
.define: request =>
for
input <- request.body.json[GreetingRequest]
greeting <- Env.use[Greetings](_.greet(input.name))
yield greeting
.at(Route.post("/api/kyo/greeting"))Lines 1, 6 and 8 differ from the ZIO version. A bar at the left edge marks them.
{ "data": { "message": "Hello, Scala!" } }YOUR STARTING POINT
Start where you are.
One toolbox. Three ways in.
Choose the path that fits your application.
Start a new project
Create a Nuxt app, choose your h34s modules, and add your first Scala handler.
Start buildingBring Scala to Nuxt
Add Scala handlers alongside the TypeScript routes you already have.
Explore the Nuxt pathBring Nuxt to Scala
Keep your Scala.js models and services. Give them a Nuxt frontend.
Explore the Scala pathFROM REQUEST TO RESPONSE
Build the whole handler.
Kyo handlers & services
Request in, body out. Wire your services once in your app.
The ZIO adapter
Write ordinary ZIO programs over the same core.
Configuration & lifetimes
Read runtime config from Scala. Share pools safely.
PostgreSQL, your way
Plug in kyo-sql or Skunk directly. No wrapper needed.
Streams & cancellation
Keep resources alive until a response finishes.
Debug in Scala
Follow Nuxt errors back to the original Scala source.
SMALL STEPS. CLEAR BOUNDARIES.
A working foundation.
A clear direction.
0.1.0-alpha.1 has the older API. 0.2.0-alpha.1 moves the core to Kyo, adds a ZIO adapter, Scala configuration, shared resources and one schema per model. Routes declared in Scala are on main for the next release; packaging remains planned.
What works today