Ok so I bundled/built a regular angular cli project using webpack for prod and then took the contents of a dist folder and put them in another project with express installed.
code:
var express = require('express');
var app = express();
var path = require('path');
app.get('/', function(req, res) {
res.sendFile(__dirname + '/' + 'index.html')
});
app.listen(3000, function() {
console.log('Example app listening on port 3000!');
});
The problem is that when i run this i get a "loading..." page when on ://localhost:3000/ and nothing else. When I check console, I get these errors
[Failed to load resource: the server responded with a status of 404 (Not Found) ://localhost:3000/inline.js
Failed to load resource: the server responded with a status of 404 (Not Found) ://localhost:3000/styles.b52d2076048963e7cbfd.bundle.js
Failed to load resource: the server responded with a status of 404 (Not Found) ://localhost:3000/main.d27eab344e583f765067.bundle.js
Failed to load resource: the server responded with a status of 404 (Not Found) ://localhost:3000/styles.b52d2076048963e7cbfd.bundle.js
Failed to load resource: the server responded with a status of 404 (Not Found) ://localhost:3000/main.d27eab344e583f765067.bundle.js]
Anyone get around this or figure out the problem? any help is greatly appreciated. The reason i'm doing this is that once the app goes to production I don't have access to "npm" so i don't have any of the ang-cli commands but only node commands. Also implementing socket IO is another reason we went the express route. if there is any alternative way can you please let me know.
Thanks