Skip to content

Unified context #22

Open
Open
@Rokt33r

Description

@Rokt33r

Both httpContext and injector are set by tachijs. To check they are set, we have to see one of them is defined like this.httpContext != null or this.injector != null.

To make it simple, I'm going to put everything in one property this.context.

So it will be like the below.

interface Context {
  req: express.Request
  res: express.Response
  inject: (key: string) => any
}

class BaseController {
  context?: Context
}

This will be implemented next version and old legacy props, inject, injector and httpContext are deprecated from v1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions