poeticninja / hapi-ninja

Boilerplate Hapi server example. Node.js, Hapi, and Swig.
MIT License
378 stars 56 forks source link

The server object is passed to the routes module, but is not used #13

Closed paulovieira closed 9 years ago

paulovieira commented 9 years ago

It's not a bug, but might be a typo.

The routes module (server/config/routes.js) is passed the server object (in the main server.js module). However server is not used in routes. That module is just returning the route table (an array with the route configurations).

I believe we should have

   server.route(routeTable);

in server/config/routes.js instead of server.js, no?

poeticninja commented 9 years ago

You are right. I used to pass around the server to have access through out the application. I changed this in the most recent commit (f2ef6bc5c77079020c225c063fdc11fa662b275b). If you need the server you just require it. Thanks!