First App (2min)
- Install Oweb via npm:
npm install owebjs- Start with a minimal app, then we will add route conventions step by step.
import Oweb from 'owebjs';
const app = await new Oweb({ uWebSocketsEnabled: true }).setup();
await app.loadRoutes({ directory: 'routes', hmr: { enabled: true, },});
const { err, address } = await app.start({ port: 3000, host: '127.0.0.1' });if (err) throw err;
console.log(`Server running at ${address}`);What this does:
- Creates an Oweb app instance (here in uWebSockets mode)
- Loads your route files from
routes/ - Enables HMR for development
- Starts the HTTP server