I have an Angular 6 app hosted on say example.com (dist folder being served using say port 5000) and a landing page folder with its HTML, CSS, JS files being served on say port 6000 and hosted on example.com/welcome
Is there any way I can merge these two such that example.com uses landing page static folder and example.com/#/* (Angular app uses hash in routing) uses dist folder?
I do not want to merge landing page into a component in Angular app due to clashing of CSS, and other issues.
I need landing page to be loaded without loading Angular app first and without changing any URL/routing logic of Angular app.
Solutions I tried:
Following code works but loads angular app first and then loads landing page. What I want is that landing page needs to be loaded first.
app.use('/welcome',express.static(__dirname + '/landing')); app.use(express.static(__dirname + '/dist')); app.get('/',(req,res)=> { res.redirect('https://example.com/welcome'); })I tried to make home component of Angular app redirect to /welcome but that too requires loading of Angular app first before the landing page.
Any solution around Express/Nginx?