Socket
Socket
Sign inDemoInstall

@nestlab/prefix-controller

Package Overview
Dependencies
46
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @nestlab/prefix-controller

Prefix controller factory for NestJS.


Version published
Weekly downloads
4
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Prefix controller

Prefix controller factory for NestJS.

Install

$ npm i @nestlab/prefix-controller

Examples

Prefix for application space


const AdminController = createPrefixController('admin');
const ConsoleController = createPrefixController('console');

@AdminController('logs')           // Base URL: /admin/logs
export class LogsController {
  // Your implementation
}

@AdminController('users')          // Base URL: /admin/users
export class UserController {
  // Your implementation
}

@ConsoleController('products')     // Base URL: /console/products
export class ProductController {
  // Your implementation
}

Prefix for versioning

const Version1Controller = createPrefixController('v1');
const Version2Controller = createPrefixController('v2');

@Version1Controller('auth')          // Base URL: /v1/auth
export class AuthController {
  // Your implementation
}

@Version2Controller('auth')          // Base URL: /v2/auth
export class AuthController {
  // Your implementation
}

Enjoy!

Keywords

FAQs

Last updated on 05 Oct 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc