DEV Community

Discussion on: Designing a better architecture for a Node.js API

Collapse
 
pacheco profile image
Thiago Pacheco

Hi Muhammad,

Thank you for sharing that.
Actually, this is an extra line that was not supposed to be in this file.
I was trying to reduce the size of the project to make it simpler, but I forgot to remove this call.
You can just remove the following line from the Controller constructor:
this.get = this.get.bind(this);

I already fixed it in the post, sorry for the error.

Let me know if that worked for you.

Collapse
 
junaidlodhi7 profile image
Muhammad Junaid Lodhi

It worked for me, Thanks a lot .

I also removed

server.get(/api/post/:params, PostController.get);
from routes.js

Thanks a lot.

Thread Thread
 
pacheco profile image
Thiago Pacheco

Perfect Muhammad, thank you very much!