Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Plugin for adding decorator and controller-based routing support to Kingworld.

License

Notifications You must be signed in to change notification settings

gaurishhs/kingworld-controllers

Repository files navigation

KingWorld Controllers

  • This plugin adds decorator and controller-based routing support to kingworld.

IMPORTANT! Bun doesn't support decorators yet, so you'll need to upgrade bun by using bun upgrade --canary

Installation

bun add kingworld-controllers

Usage

import { Controller, Get, kwControllers } from 'kingworld-controllers'; 

// /users prefix
@Controller('/users/')
class UsersController {
  @Get()
  index() {
    return 'Hello World';
  }
}

const app = new KingWorld();

app.use(kwControllers, {
  controllers: [UsersController],
});

app.listen(3000);

License

  • This project is licensed under the MIT License - see the LICENSE file for details

About

Plugin for adding decorator and controller-based routing support to Kingworld.

Resources

License

Stars

Watchers

Forks

Packages

No packages published