Reputation: 11
My application is serving angularjs's index.html from node as below,
app.get('/', function (req, res) {
res.render('index');
})
When I open the application in browser, I see following errors on node console, The below files are not found,
GET /node_modules/zone.js/dist/zone.js 404 7.506 ms - 172
GET /node_modules/core-js/client/shim.min.js 404 8.439 ms - 178
GET /systemjs.config.js 304 9.265 ms - -
GET /node_modules/systemjs/dist/system.src.js 404 12.038 ms - 179
GET /node_modules/zone.js/dist/zone.js 404 0.622 ms - 172
GET /node_modules/systemjs/dist/system.src.js 404 0.589 ms - 179
I tried using CDN path as below,
<script src="https://unpkg.com/[email protected]/client/shim.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/zone.js"></script>
<script src="https://unpkg.com/[email protected]/dist/system.src.js"></script>
but then it is unable to load some other js files under node_modules. This all works fine when I use angular pages statically without express. How do I refer to js files under node_modules so these are loaded correctly.
Upvotes: 1
Views: 1073