Hello, I am new to this vagrant idea and I have a question (I hope it makes sense here).
Imagine I have a laravel app so I can go to: http://homestead.app:8000. So far so good.
Then imagine I want to use Angular with, well, yeoman maybe. Yeoman is a different app running on let's say port 4000. With yeoman I could proxy all my request to 8000.
If I run all of this in my machine, I can just serve laravel and also launch yeoman app. I can then go to localhost:4000 to see my angular app running.
So with homestead, I can go to port 8000 to see my API but where I want to go, is to port 4000 where my angular app lives.
So, is there anything I can do to run also that yeoman app and also be able to access it via http://homestead.app:4000 ? Maybe doing some extra configuration and running it via the ssh.
Thank you.
I made some good steps.
I can make a port forwarding on homestead.rb like:
config.vm.network "forwarded_port", guest: 4000, host: 4000
So I can run my angular app and I can access it via homestead.app:4000 or even localhost:4000. So far, so good.
To make angular proxy the requests to the laravel app, I proxy them to the port 80 and it works, but when I add another app, the angular app will then proxy to that new app.
Even when I can do
homestead.app:8000
or
app2.app:8000
And get different apps, seems like in the VM they both run on the port 80 so I can't tell my angular app what app to use as a proxy API.
Ideas?
I got the answer thanks to @trq at laravel irc channel.
I can use the hostname (homestead.app) and also the port so I get redirected to the app I need.
Fantastic.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community