Hello,
I have such a problem, I can't upload style files and scripts on the server.
file tree:
--bootstrap --css --js ---libs in the console gives an error
localhost/:8 GET http://localhost:3000/bootstrap/css/bootstrap.min.css localhost/:9 GET http://localhost:3000/css/template.css localhost/:11 GET http://localhost:3000/js/libs/jquery%201.12.5-pre.js localhost/:12 GET http://localhost:3000/bootstrap/js/bootstrap.min.js localhost/:14 GET http://localhost:3000/js/libs/angular.min.js localhost/:15 GET http://localhost:3000/js/libs/angular-route.min.js localhost/:16 GET http://localhost:3000/js/libs/angular-resource.min.js localhost/:17 GET http://localhost:3000/js/libs/angular-cookies.min.js localhost/:19 GET http://localhost:3000/js/app.js localhost/:20 GET http://localhost:3000/js/controllers.js localhost/:21 GET http://localhost:3000/js/directives.js 404 (Not Found) server.js code
var express = require("express"); var app = express(); app.use(express.static('TestApp')); app.use(express.static(__dirname + '/TestApp')); app.get('/', function(req,res) { res.sendFile(__dirname + '/index.html'); }); var server = app.listen(3000, function() { console.log('working on', server.address().port); }); I tried to prescribe it, but then another problem arises, and it also does not load anything
app.get('*', function(req,res) { res.sendFile(__dirname + '/index.html'); });