Breeze / breeze.js.samples

Breeze JavaScript Client sample applications
MIT License
96 stars 85 forks source link

Server cannot route '/' #13

Closed cefn closed 10 years ago

cefn commented 10 years ago

I've been struggling to get any Zza Breeze/Node/Mongodb sample to work on my machine. Don't know if there's something unspecified in the required build or package dependency declarations.

I've fixed the issue associated with the official sample from http://www.breezejs.com/samples/zza , which arises from it promiscuously upgrading to Express 4.0 (which isn't compatible with the API calls it makes). However, even after that fix I just get the text "Cannot get /" as the front page of the sample app.

Sadly I get exactly the same behaviour from the version you're maintaining, and also the version available at... https://github.com/IdeaBlade/Breeze/tree/master/Samples_Unpublished/Zza/Zza.ExpressServer ...so there must be something up with my environment I guess but I can't trace the way the front page is served. Visiting http://localhost:3000/breeze/zza/Products does give me a json dump of the product database, so something must be fairly functional, but there's no front page.

I'm a bit puzzled how any of these different implementations are meant to get app resources to satisfy route ('/'). Is there maybe a missing module in my build which isn't being pulled in by npm install (package.json) ?

Versions I'm running... $ mongod --version db version v2.6.0 $node --version v0.10.26 $ npm -v 1.4.4

Be glad of any suggestions to explain why the '/' route is dying.

cefn commented 10 years ago

OK, found a workaround. I needed to...

cd client

...then run...

node ../server/server.js

...meaning node to be able to find app/ css/ and so on. Whatever mechanism makes this happen automagically isn't working for me (if there's meant to be such a mechanism).

ThomasBurleson commented 10 years ago

The application/web server expects the current working directory to be in the /client directory. So, you are correct:

cd <projectDir>/client
node ../server/server.js

The app server will serve the web content (static files and the Zza application) and acts as the remote service for the RESTful web service calls. The Zza client will make data requests to the app server which will then route those requests to load/persistent content from/to the mongo database.

Zza Client <--> NodeJS Web & App Server <--> Mongo Database

wardbell commented 10 years ago

Thanks, Thomas. The fault is entirely mine. We have made radical changes to this sample recently and published it without updated documentation. I've got excuses but that's the fact. I will update the doc so soon. Meanwhile, I've committed updated comments to server.js.

cefn commented 10 years ago

Thanks, Ward and Thomas. I'm excited to try and work with Breeze now.