Skip to content

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);

to manage your API routes better, you can create an api folder and put all your route files there.

main.ts
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);
api/auth.ts
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');
});
api/user.ts
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}`);
});
  • POST /auth/login
  • POST /auth/register
  • GET /user/:id

You can now run your application with Deno:

Terminal window
deno run --allow-net main.ts