Express
Use Runable as the last middleware in an Express application.
Installation
pnpm add runable vue vue-router express
pnpm add -D @types/expressConfiguration
// server.ts
import Express from "express";
import { express } from "runable/adapters/express";
const app = Express();
app.get("/api/health", (_req, res) => {
res.json({ status: "ok" });
});
app.use(express());
app.listen(3000);express() returns a RequestHandler. Place it after API routes and any middleware that must process requests before the frontend. Initialization and rendering errors are forwarded to the next Express error middleware.
Reuse an instance
import { createRunableApp } from "runable";
import { express } from "runable/adapters/express";
const runableApp = createRunableApp();
app.use(express({ runableApp }));On this page