How to require my modules for heroku to understand

How to require my modules for heroku to understand


Hello everyone i am making a social network and i came to the point where i need multiple users to test my app so i tried hosting it, however heroku does not work as supposed when using require to get my modules.
I use modules for better organisation, here is the code that makes the error:

app.get("/login", require("./routs/loginGet.js"));"/login", require("./routs/loginPost.js"));
//app.get("/logout", require("./routs/logout.js"));

app.get("/conversation/:chatId", require("./routs/conversationGet"));'/message/:chatId/', requiresLogin, require("./routs/messagePost.js"))

The error says no such module. Please tell me the correct way to organize my code in modules so that heroku accepts it.


Did you include them in your package.json file?


They are short js parts which i created, but i found what was causing the problem, i removed the .js abreviations to the path and it worked.