Reputation: 13
I want to run index.html and i get it from angular2 app after ng build.
I tried these two lines of code one by one but these are not working for me app.use(express.static(path.resolve(__dirname+'/public/index.html'))); app.use(express.static(path.resolve(__dirname+'/public')));
Any idea how to resolve this?
Your help will greatly appreciated
Upvotes: 1
Views: 62
Reputation: 5088
I will assume you already have the correct path to your public
folder and also the ng build
builds out to the public
folder with the same path.
Do: app.use(express.static(path.join(__dirname, 'public')));
Upvotes: 0