Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition #12

Open
metacatdud opened this issue Jul 16, 2020 · 0 comments
Open

Race condition #12

metacatdud opened this issue Jul 16, 2020 · 0 comments

Comments

@metacatdud
Copy link

metacatdud commented Jul 16, 2020

Hi,
I just found this. Niiice!
Looks like a good idea for a very clean, general purpose architecture. I took it for a drive test and I run into:
headers already send situation

The issue lies here:

public execute (req: express.Request, res: express.Response): void {
    this.req = req;
    this.res = res;
    this.executeImpl();
 }

If I convert

userRouter.post('/',
  (req, res) => createUserController.execute(req, res)
)

to

userRouter.post('/', async (req, res) => { 
     const createUserController = new CreateUserController(/useCaseGoesHere/)
     await createUserController.execute(req, res)
 })

it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant