0

I a new to ionic framework.

I downloaded a sample project from github

https://github.com/driftyco/ionic-angular-cordova-seed

And then I wanna test it on browser

http://ionicframework.com/docs/guide/testing.html

$ionic serve

The terminal show

Running serve task...
Running dev server at http://0.0.0.0:8100
Running live reload server at http://0.0.0.0:35729

and chrome open a new tab with URL: localhost:8100

The page show No data received with Error code : Unable to load the webpage because the server sent no data. Error code: ERR_EMPTY_RESPONSE

anyone has ideas on it?

note that I tried other sample project form github, same thing happened.

Ken Hui
  • 368
  • 3
  • 17

3 Answers3

1

This happened to me when I called 'ionic serve' from the 'www' folder instead of the root of the project. Make sure you are calling the serve command from the right location.

Mackenzie Browne
  • 443
  • 3
  • 10
  • 1
    I am running the serve command according to this page instruction. http://ionicframework.com/docs/guide/testing.html There said "Testing your app in a browser is as simple as running the serve command in your project's root folder." Anyway I tried to run at WWW folder. Same thing happens. – Ken Hui Aug 01 '14 at 01:25
0

I'm not really sure what the problem is with ionic's serve task, but what I do is, use the command that is built in cordova

cordova prepare && cordova serve

I use cordova prepare just to make sure the latest changes are served

And I also recommend using Ripple when working like this

akumapunk
  • 32
  • 3
  • 1
    It gives Package Metadata table on web browser. Select either ios or android could run the application. – Ken Hui Aug 01 '14 at 01:23
0

use python -m SimpleHTTPServer inside of www directory instead of ionic serve , it works for me

  • @akumapunk gives a correct answer as well. I mark this answer correct due to it is the simplest method and gives similar result as ionic serve. Thanks – Ken Hui Aug 01 '14 at 01:27