CouscousPHP / Couscous

Couscous is good.
https://couscous.io
Other
840 stars 104 forks source link

No address for server when previewing #28

Closed maxailloud closed 9 years ago

maxailloud commented 9 years ago

Preview features seems to be broken.

I launched it as said on the website:

php couscous.phar preview .

Here is what I get:

Generating /home/maxime/workspace/Claroline to /home/maxime/workspace/Claroline/.couscous/generated Fetching template from https://github.com/CouscousPHP/Template-Default.git Server running on .

I don't have any address to look at, and http://localhost:8000/ is not accessible either.

mnapoli commented 9 years ago

Ouch that is weird :/

Since you have PHP 5.5 I guess running php -S localhost:8000 should work? Or maybe it's the localhost that Ubuntu might not like, maybe php -S 127.0.0.1:8000 should be better?

maxailloud commented 9 years ago

For the address not being displayed maybe it comes from https://github.com/CouscousPHP/Couscous/blob/master/src/Command/PreviewCommand.php#L121

The argument doesn't have a value, even if it's supposed to have a default value. Maybe the issue come from it.

And for the php -S thing I don't really know how it works so I cannot help on that side.

mnapoli commented 9 years ago

Yep that's weird since as you said there is a default value

I tried with a Vagrant box running latest Ubuntu and it's working for me.

Just to be sure:

maxailloud commented 9 years ago

does php -S localhost:8000 work?

When I access the url I get a 404.

does running php couscous.phar preview 127.0.0.1:8000 work?

It's working like this. So there mey be an issue with the default value for the address. I also get the address display in the console.

mnapoli commented 9 years ago

OK the 404 is normal I guess because there is no index.html in the directory, but it's just to make sure the command runs.

Cool so maybe localhost is causing problems (I hope that's it), I'll replace it with 127.0.0.1 and we'll se how it goes.

mnapoli commented 9 years ago

I've pushed and re-generated the phar!

Thanks for your help, hopefully that will work!

maxailloud commented 9 years ago

If I launch php couscous.phar preview localhost:8000 it's working too.

I just found the issue. And it was me.

I wrote php couscous.phar preview . so for the command the address was the dot I put at the end of the command. I thought the dot was for the path where files will be generated. Launching the command php couscous.phar preview without the dot is working and displaying the address. It was displaying the address earlier, but as it was the dot I thought the dot was the end of the sentence.

maxailloud commented 9 years ago

Removing the dot at the end of the command in the website could be a good idea. You put a dot for the second but not for the first.

mnapoli commented 9 years ago

Ah yeah good catch! I'll remove it from the website thanks :)