Hi, I am trying to build an MVC model API. I'm having troubles making
queries. It seems like I don't export my connection variable correctly,
cause I've got a "connection.query is not a function" error.
I've tried to export it using exports.module but as I already have router
to export, I had
Hi, I'm having the same problem.. If you found one, please share it !
Thanks !
Le vendredi 21 juin 2019 02:32:49 UTC+2, Ketan Joshi a écrit :
>
> I am looking for a working express js mysql mvc tutorial, i have tried
> many on the net but ,the code that they have provided does not work, some
In index.js you are not exporting the connection object, you are only exporting
router object. That is why you are getting the error when you reference
connection object in booksModel.js. You could try the following:
Step 1: In index.js include connection in the module exports as below:
module.ex