I have a javascript file with more than 200 lines of code for front end logic like what happens when someone clicks on button, image, etc. like a game.
I am not able to figure this out. How to link/ include, tell expressjs to use that file for front end logic and not just rely on .ejs files ?
I am not asking for module.exports to export particular parts from file. I want the whole file to be exported.
Please help.
app.use("/", express.static(__dirname));it will serve your static files so you can use <script tag to include the file.