Answer the question
In order to leave comments, you need to log in
How to properly use routing in Express + Angular to serve files?
I use this variant of routes for the admin panel
app.get('/admin/:folder/:file', function(req, res) {
res.sendFile(__dirname+'/admin/' + req.params.folder + '/' + req.params.file.replace('.map',''));
});
app.get('/admin/*', function(req, res) {
res.sendFile(__dirname+'/admin/index.html');
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question