I am trying to serve an Angular 2 app from node js routing. After serving index.html it is giving below errors
localhost:3000/client/src/styles.css 404 (Not Found)
localhost:3000/client/srcsystemjs.config.js 404 (Not Found)
localhost:3000/client/srcsystemjs.config.js 404 (Not Found)
Below are my files and folder structure
1)routes/index.js
router.get('/', function (req, res, next) {
res.sendFile('/angular2/login-module/client/src/index.html');
});
2)index.js
app.use(express.static(__dirname + 'client'));
3)App folder structure
Please someone help. Thanks in advance.
via Nitya
No comments:
Post a Comment