1.0.1 • Published 10 months ago

elysia-group-router v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

elysia-group-router

Group router for Elysia, to help you separate and manage your groups.

Install

bun add elysia-group-router

Usage

1. Register the plugin

import { Elysia } from 'elysia';
import groupRouter from 'elysia-group-router';

new Elysia().use((app) => groupRouter(app, 'groups')).listen(3000);

2. Create your first group in the groups directory

// file: groups/hello/index.ts
// url: http://localhost:3000/hello

import type { Elysia } from 'elysia';

export default function helloGroup(app: Elysia, prefix: string) {
  return app.group(prefix, (app) => app.get('', () => 'hello'));
}

License

MIT

1.0.1

10 months ago

1.0.0

10 months ago