barryels / realworld-mithril

Starter kit for new RealWorld framework implementations
https://realworld.io
37 stars 3 forks source link

Using npm start, localhost:3000 doesn't work #36

Closed shambhusharma closed 7 years ago

shambhusharma commented 7 years ago

I've installed Node.js -v 6.10.2 and npm -v 3.10.10

And I've used following steps to install:

  1. git clone https://github.com/barryels/realworld-mithril.git
  2. cd realworld-mithril
  3. npm install
  4. npm start

Step 4 doesn't show any error, but http://localhost:3000 doesn't work!

When searching for any solutions for this, I found the following command, using which the application shows up in browser: node ./node_modules/http-server/bin/http-server public -p 3000 -s But I'm not sure if this is the proper approach to this.

I'm very much new to Mithril or any JS Framework, So I really appreciate any help in getting started here. Thanks

barryels commented 7 years ago

Thanks for the feedback... What OS are you using?

Also, are you saying that: node ./node_modules/http-server/bin/http-server public -p 3000 -s works?

shambhusharma commented 7 years ago

I'm using Windows 10.

And yes, it works with that command, but the page shows as 'Loading...' for Feeds list, Tags list etc.

barryels commented 7 years ago

Cool, I'll update the run script to include node ./node_modules.... seems to be a Windows specific issue.

The 'Loading...' is because it seems the demo API is down go here: http://conduit.productionready.io/api/tags

shambhusharma commented 7 years ago

@barryels Thanks for the update. Nownpm run ui-server works, but npm start still doesn't start the server.

It worked for me after changing the script to run both of them in parallel (by replacing & with | ), as: "dev": "npm run ui-build-js-watch | npm run ui-server"

But looks like this syntax is platform specific, as mentioned in an answer at stackoverflow here. And as a solution npm-run-all module is suggested.

I'll try this approach tomorrow and update here if that works on both Windows and Ubuntu. Thanks

barryels commented 7 years ago

@shambhusharma please test and let me know if this fixes the issue... You'll need to run npm install first to install the new npm-run-all dep, then npm start

shambhusharma commented 7 years ago

@barryels Sorry for the delay in replying to this.

I've tested it locally and it is working properly now. Thanks a lot.

barryels commented 7 years ago

Glad to hear it :smile: