Cześć ,mam problem z linkowaniem pliku statycznego w express. Prosty kod w express.js(plik app.js):
app.get('/dashboard', function(req,res){
res.sendFile('dashboard.html', { root: path.join(__dirname, './././main/html') });
});
Oczywiście require('path") etc. zrobione. Problem z tym, że nie chce mi wrócić w strukturze folderu "do góry".
Struktura folderu:
/js
/node
/loginform
/app.js
/main
/html
/dashboard.html
Wywala mi takiego errora:
Error: ENOENT: no such file or directory, stat C:\js\node\loginform\...\main\dashboard.html