Picture of Steven Hancock
Problem with grunt server
by Steven Hancock - Thursday, 18 August 2016, 11:13 PM
 

Whenever I run grunt server to display a course, the course never renders. It tells me localhost connection is refused.

I'm able to start a server with gulp and view the course just fine, and I can start a server with MAMP and view the course. But I'm curious why the grunt server is not working. I have tried changing the port, but no luck. I've tried different browsers. I've included a screen shot of the error.

Any ideas?


Picture of Matt Leathes
Re: Problem with grunt server
by Matt Leathes - Friday, 19 August 2016, 10:20 AM
 

Do gulp or MAMP also use localhost as the domain name when creating a server or something different? If something different then it's likely to be something in the configuration of your computer that's blocking access to localhost.

When running $ grunt server you could try changing localhost to 127.0.0.1 (the loopback address) or your computer's IP address.

Picture of Steven Hancock
Re: Problem with grunt server
by Steven Hancock - Friday, 19 August 2016, 10:23 PM
 

Yes, gulp uses localhost. MAMP is actually MAMP pro so it allows you to define a name for the server. 

Great thought on using the loopback address. The course will display using that. I would like to understand why, but at least it is working.

Picture of Matt Leathes
Re: Problem with grunt server
by Matt Leathes - Monday, 22 August 2016, 2:04 PM
 

Yes that's very odd, I can't think of any obvious reason why that would work in gulp and not grunt server.

I tend to just use browser-sync myself as it gives you loads of options that aren't available in grunt server.