QUERY:
Is there a way to modify the server.js file so that the three.js script in index.html does not display an error message like
?Cannot GET /node_modules/three/three.js
Code Snippet: index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8>
<title>Title</title>
</head>
<body>
<h1>Hello friends!</h1>
<script src="../node_modules/three/three.js"></script>
</body>
</html>
JS Code: server.js
var express = require('express');
var app = express();
app.use(express.static(__dirname + '/../client/'));
app.get('/', (req, res) => {
res.render('index');
});
app.listen(3000, () => {
console.log('VTEC JUST KICKED IN Y0');
});
Directory Structure:
https://i.stack.imgur.com/avbRm.png
Package.json Configuration:
{
"name": "Morningharwood",
"version": "1.0.0",
"description": "",
"main": "server/server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server/server.js",
"dev": "nodemon server/server.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/matthewharwood/MorningHarwood.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/matthewharwood/MorningHarwood/issues"
},
"homepage": "https://github.com/matthewharwood/MorningHarwood#readme",
"dependencies": {
"express": "^4.13.4",
"jade": "^1.11.0",
"three": "^0.73.2"
},
"devDependencies": {
"nodemon": "^1.8.1"
}
}