Elysia Integration
Your AbsoluteJS server IS an Elysia server. Everything you know about Elysia works here.
#Overview
AbsoluteJS runs on top of Elysia without hiding Elysia. Your app architecture is still standard Elysia: compose plugins, define routes, validate data, and use lifecycle hooks for cross-cutting behavior.
Runtime modelone long-lived Elysia server handles pages, APIs, and background scheduling plugins.
Plugin boundarieskeep concerns isolated (CORS, auth, cron, networking) using plugin/group scope.
Type flowschemas and route definitions in Elysia drive end-to-end types through handlers and clients.
AbsoluteJS rolerendering, build/asset pipeline, and framework host integration layered onto the same server.
#Foundation
AbsoluteJS doesn't wrap or abstract Elysia: it enhances it. You write standard Elysia code with AbsoluteJS-specific rendering and build utilities mixed in:
TS
// Your AbsoluteJS server IS an Elysia server
// Everything you know about Elysia works here
import { Elysia } from 'elysia';
import { prepare, asset, networking } from '@absolutejs/absolute';
import { handleReactPageRequest } from '@absolutejs/absolute/react';
const { absolutejs, manifest } = await prepare();
new Elysia()
.use(absolutejs)
// Use any Elysia plugin
.use(cors())
.use(swagger())
// Page routes
.get('/', () => handleReactPageRequest({ Page: Home, index: asset(manifest, 'HomeIndex') }))
// API routes: just regular Elysia
.get('/api/users', () => getUsers())
.post('/api/users', ({ body }) => createUser(body))
// AbsoluteJS networking plugin
.use(networking);#Page Guide
Plugin Compositionhow to structure and scope plugins
Validationrequest/response schemas and guarded routes
CORSorigin policy, credentials, and per-group config
Cron Jobsscheduled tasks with
@elysiajs/cronMiddlewarehook order and guard strategy
Networking Pluginstartup behavior and host/port exposure
#Integration Baseline
Start from Elysia defaults, then add only required plugins.
Keep route-level validation next to handlers.
Use plugin/group scope boundaries to avoid cross-cutting side effects.
Keep recurring jobs in the cron page and request lifecycle concerns in middleware.
Reference: Elysia docs