DEV Community

Discussion on: Step by step React, NodejS and MySQL Simple Full Stack Application 2018 (part: 3)

Collapse
 
maikpro profile image
Maik

thanks for the tutorial it helps me a lot... :)

But you forgot to pass "connection" from "server.js" to "html-routes". It will give you an error like "connection couldn't be found..."

So you need to change this lines of code:

( in the server.js file )
require('./routes/html-routes')(app);
to => require('./routes/html-routes')(app, connection);

and ( in the html-routes.js )
module.exports = (app) => {...});
to => module.exports = (app, connection) => {...});

Collapse
 
kmaryam27 profile image
Maryam Keshavarz

thank you so much for your comment I hadn't that issue but as soon as possible I will check and will update my post

Collapse
 
zizuar profile image
Donald P Polansky • Edited

Yup, that's what I was missing too.. I didn't have the auth issue as they already patched that.. but.. Pretty much did a facepalm when I read the comment.
Thanks to both of you!

Collapse
 
rizqiya profile image
Saputra, RW

this comment really help ... thanks