deansatch's avatar

use localhost instead of test domain with homestead

I need to develop with Google's oauth2 api which requires a top level domain, but it also allows localhost. The app I'm working on is currently setup in homestead with a .test domain but for this I am going to need it to be served as http://localhost instead. Any ideas how I can do that? I've tried specifying it in my yaml file (map: localhost) but it didn't work

0 likes
4 replies
kevinbui's avatar

You might want to use ngrok, which is already part of Laravel Homestead. Ngrok will generate a public url for your site.

That's how I implemented Google's oauth2 API, or any other oauth2 services.

deansatch's avatar

Thanks. I suppose that is an option although it would have to be a last resort. I'm not keen on opening up my local dev environment to the public, even if the url is unlikely to be guessed

deansatch's avatar

I just ended up mapping a .com domain to my dev environment in /etc/hosts - did the trick

1 like
rpm's avatar

I've mapped site(s) in .yaml file in .com and .test domain and I can see those already in /etc/hosts. However, it's not working for me.

Could you please share detailed step as how you mapped .com in etc/hosts.

Thank you.

Please or to participate in this conversation.