Although my backend is successfully serving other files, I have encountered an issue with loading new files that are located in a folder named js within the directory. These specific files are not being loaded, and despite spending an hour trying to troubleshoot, I haven't been able to pinpoint the exact reason for this. My initial assumption is that it may be a syntax error.
In my HTML file, the code I have used is as follows:
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/TweenMax.min.js"></script>
<script type="text/javascript" src="js/cooltext.animations.js"></script>
<script type="text/javascript" src="js/cooltext.min.js"></script>
Meanwhile, in my app.js file, I have included the following code:
app.get('/js/jquery-1.10.2.min.js', function (req, res) {
res.sendFile(__dirName + '/js/jquery-1.10.2.min.js');
});
app.get('/js/TweenMax.min.js', function (req, res) {
res.sendFile(__dirName + '/js/TweenMax.min.js');
});
app.get('/js/cooltext.animations.js', function (req, res) {
res.sendFile(__dirName + '/js/cooltext.animations.js');
});
app.get('/js/cooltext.min.js', function (req, res) {
res.sendFile(__dirName + '/js/cooltext.min.js');
});