0

I've created a sample application following http://towerjs.org/screencasts.

I've installed all deps with npm and I've also a local mongodb instance up and running.

Anyway every url I try to access like

http://localhost:3000/posts/
http://localhost:3000/posts/index
...

I got

No path matches /posts/
No path matches /posts/index
...

Here my sources: http://dl.dropbox.com/u/50740523/tower-app.zip

Regards, Giacomo

gsscoder
  • 3,088
  • 4
  • 33
  • 49
  • this looks like a bug, please post it on the github issues page: https://github.com/viatropos/tower/issues. It's b/c the routes probably aren't handling trailing `/`. And `/posts/index` isn't a route. This should work: `http://localhost:3000/posts`. Will fix. – Lance Apr 29 '12 at 17:07
  • I've posted the issue on github.com. I've also done a test removing trailing `/` but routes can't "hook" on controller... – gsscoder May 06 '12 at 05:49

1 Answers1

2

Looks like it's your /config/routes.coffee file. It appears as if you've copied the routes example from the towerjs.org website, along with copying most of your other files directly from those examples. But those examples aren't "complete", and the code won't work like this.

My suggestion is to generate a new app, then generate a few scaffolds:

tower generate scaffold User name:string email:string hasMany:posts

tower generate scaffold Post content:string belongsTo:user

Then just run:

tower server -e development

And check it out at localhost:3000 to make sure everything just works properly on your system. Then, checkout the routes.coffee file, controller, and models this comes up with just to see how a simple system works. Then you can start playing with adding bits and pieces of functionality from within an app you know runs. That way, when something breaks it you will be able to quickly see why. I'm trying to put together detailed walk-throughs of putting together a simple but functional Tower app, however I'm also learning as I go, so it is going to be a slow process. This, however, should hopefully get you moving forward again.

Sorry this probably wasn't the answer you were looking for, but looking at what you have in your folder, I'm not sure how to just take those pieces and make them work together, because they are essentially chunks of examples strung together, and not a functional app. For instance, notice in your routes.coffee file that you reference a sessions controller and an admin "namespace", but provide code for neither of these. It appears as if your models and controllers are doing similar. Hope this helps.

Edub Kendo
  • 473
  • 2
  • 11