New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nestlab/prefix-controller

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestlab/prefix-controller

Prefix controller factory for NestJS.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 05 Oct 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc