Quick Start
Yelix is Deno based, so make sure you have Deno installed.
Just use YelixHono instead of Hono to create your app.
import { YelixHono } from '@yelix/hono';
const app = new YelixHono();
app.get('/', (c) => { return c.text('Hello, Yelix!');});
Deno.serve(app.fetch);API Folder Management (Recommended)
Section titled “API Folder Management (Recommended)”to manage your API routes better, you can create an api folder and put all your route files there.
import { YelixHono } from '@yelix/hono';import { AuthApp } from './api/auth.ts';import { UserApp } from './api/user.ts';
const app = new YelixHono();
app.route('/auth', AuthApp);app.route('/user', UserApp);
Deno.serve(app.fetch);import { YelixHono } from '@yelix/hono';
export const AuthApp = new YelixHono();
AuthApp.post('/login', (c) => { return c.text('Login Endpoint');});
AuthApp.post('/register', (c) => { return c.text('Register Endpoint');});import { YelixHono } from '@yelix/hono';
export const UserApp = new YelixHono();
UserApp.get('/:id', (c) => { const { id } = c.req.param(); return c.text(`User ID: ${id}`);});Current Endpoints
Section titled “Current Endpoints”POST /auth/loginPOST /auth/registerGET /user/:id
You can now run your application with Deno:
deno run --allow-net main.ts