Skip to content

Avoid global state #29

@Strate

Description

@Strate

As for me, having global state like this:

import "./SomeController" // import result affects as a global variable
let app = createExpressServer() // express server implicitly use "SomeController"

is not a good idea, because is handles like global variables. For example, this requries to clear metadata storage before each functional test. I think it could be better, if you made this opt-in, and add ability to explicit pass controllers, interceptors and other citizens to createExpressServer:

import SomeController from "./SomeController"
import SomeInterceptor from "./SomeInterceptor"
let app = createExpressServer(
  SomeController,
  SomeInterceptor
)

or somehow else. What do you think about it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions