hapipal / boilerplate

A friendly, proven starting place for your next hapi plugin or deployment
https://hapipal.com
184 stars 26 forks source link

Comment a bit on boilerplate structure #28

Closed anttilinno closed 8 years ago

anttilinno commented 8 years ago

Could you comment a bit, in your opinion, what should the plugins and methods directories contain.

Methods are route handlers? And plugins should contain code for modules that are not route handlers? Maybe update tutorial a bit.

mattboutet commented 8 years ago

Some of this is covered by the Haute Couture documentation: https://github.com/devinivy/haute-couture - for example, the methods directory should contain server methods (http://hapijs.com/tutorials/server-methods) and Route handlers should, generally, live in /routes.

I think it might be helpful if we made the Haute Couture documentation link more prominent in the ReadMe, as that does a lot more explaining of the file/directory structure.

anttilinno commented 8 years ago

Ok, maybe just add a bit of code to the methods dir, for the trigger happy like me :) It seems a bit lonely being empty. I will pester haute-couture folk with questions then.

mattboutet commented 8 years ago

@anttilinno - if you wanted to see a super-basic example of some of the stuff that might go in models/routes/plugins, you can check out https://github.com/mattboutet/user-boilerplate , which is built on top of this boilerplate.

anttilinno commented 8 years ago

Thank you for your advice. I'm having hard time getting up to speed with hapi, seemingly suitable project structure and starting node :laughing: