To serve static files such as images, CSS files, and JavaScript files, use the express.static built-in middleware function in Express.
Pass the name of the directory that contains the static assets to the express.static middleware function to start serving the files directly.
Example:- Use the following code to serve images, CSS files, and JavaScript files in a directory named public:
app.use(express.static('public'));
Now, you can load the files that are in the public directory:
http://localhost:3000/images/kitten.jpg
http://localhost:3000/css/style.css
http://localhost:3000/js/app.js
http://localhost:3000/images/bg.png
After this your script will be loaded successfully.
<script type="text/javascript" src="js/jquery-2.1.4.js"></script>
For more reference see this link - http://expressjs.com/en/starter/static-files.html
Hope this will help to solve your query !!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…