Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

routing-controllers

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

routing-controllers - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1-alpha.1

.github/workflows/nodejs.yml

18

package.json
{
"name": "routing-controllers",
"private": false,
"version": "0.8.0",
"version": "0.8.1-alpha.1",
"description": "Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.",

@@ -16,2 +16,10 @@ "license": "MIT",

"url": "https://github.com/19majkel94"
},
{
"name": "Jonathas Morais",
"url": "https://github.com/jotamorais"
},
{
"name": "adenhertog",
"url": "https://github.com/adenhertog"
}

@@ -42,2 +50,6 @@ ],

},
"peerDependencies": {
"class-transformer": "^0.2.3",
"class-validator": "0.10.1"
},
"devDependencies": {

@@ -87,6 +99,2 @@ "@types/chai": "^4.2.3",

},
"peerDependencies": {
"class-transformer": "^0.2.3",
"class-validator": "0.10.1"
},
"scripts": {

@@ -93,0 +101,0 @@ "build": "rimraf build && echo Using TypeScript && tsc --version && tsc --pretty",

@@ -1401,2 +1401,35 @@ # routing-controllers

For other IoC providers that don't expose a `get(xxx)` function, you can create an IoC adapter using `IocAdapter` like so:
```typescript
// inversify-adapter.ts
import { IoCAdapter } from 'routing-controllers'
import { Container } from 'inversify'
class InversifyAdapter implements IocAdapter {
constructor (
private readonly container: Container
) {
}
get<T> (someClass: ClassConstructor<T>, action?: Action): T {
const childContainer = this.container.createChild()
childContainer.bind(API_SYMBOLS.ClientIp).toConstantValue(action.context.ip)
return childContainer.resolve<T>(someClass)
}
}
```
And then tell Routing Controllers to use it:
```typescript
// Somewhere in your app startup
import { useContainer } from 'routing-controllers'
import { Container } from 'inversify'
import { InversifyAdapter } from './inversify-adapter.ts'
const container = new Container()
const inversifyAdapter = new InversifyAdapter(container)
useContainer(inversifyAdapter)
```
## Custom parameter decorators

@@ -1403,0 +1436,0 @@

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