I'm feeling frustrated about this particular issue. The problem seems to be well-solved, and my code looks fine, but I can't figure out what's wrong . . .
I have a JavaScript file connecting to my survey page, which I've added at the bottom of the <body>
tag like this:
<script type="text/javascript" src="/static/questions.js"></script>
In my server.js file, I've tried:
app.use(express.static('public'));
app.use(express.static('data'));
app.use('/static', express.static('public'));
app.use('/static', express.static('data'));
I thought I covered all bases there . . . 'public' contains the HTML pages, while 'data' holds my JSON and JavaScript files.
Directory structure:
root
-app
--data
--public
server.js
However, I keep encountering a failure to load JS error.
https://i.stack.imgur.com/fnDQ5.png https://i.stack.imgur.com/Ly9Et.png
What's going on here?