Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Comments/description in the code #74

Closed
chacliff opened this issue Mar 31, 2015 · 6 comments
Closed

Comments/description in the code #74

chacliff opened this issue Mar 31, 2015 · 6 comments
Labels

Comments

@chacliff
Copy link

I wanted to ask that you might add a general description to the top of the documents about what they do and control flow to and from the documents. I'm new to the industry and we are using hapi for a webservice project but i would like more information to help the learning process. Especially considering this is an example posted directly on Hapi's site.

@jedireza
Copy link
Owner

jedireza commented Apr 1, 2015

@chacliff thanks for opening an issue. Although we probably won't add comments throughout the code, it is a good idea to address this stuff via guides on the wiki.

@chacliff
Copy link
Author

chacliff commented Apr 1, 2015

yes that would be very helpful, then the project could be considered tutorial material. Disecting your project and jumping back and forth between the api references and your project has been fun, but speeding up the process would be appreciated.

@jedireza
Copy link
Owner

I was going to close this issue but maybe we could take this as an opportunity to outline the things we should document. Would you be willing to share about your experience going between the api references and this project? What things would make that a smoother process?

@chacliff
Copy link
Author

as nasty as they are, inline comments would be nice or a description at the top of each document no matter how trivial. That's just generally speaking, I never did figure out how your authentication worked. I tried to implement it myself in a similar fashion. Your directory structure make sense, but maybe explain why you chose to make everything an individual plugin as apposed to making a singular file of routes and sending to controller files. Maybe just adding to the wiki a documentation of the whole thought process on the design would be a good idea too. I'm not sure i ever completely wrapped my head around it. Its like you made reusable plugins that you never planned to reuse. Maybe i never ended up getting a deep enough understanding to know the true purpose.

@wle8300
Copy link

wle8300 commented Jun 23, 2015

@chacliff Express and Hapi are different animals. If you're coming from Express, I would recommend acting like you're a n00b to NodeJS and start at the top of http://hapijs.com, read the "Getting started," "Tutorials," and read (several!) online guides to building simplistic Hapi 8 apps. Build whatever they tell you to. Note: follow Hapi 8 tutorials only. The previous Hapis are gonna confuse you.

Hapi doesn't really dictate how you organize a project really. They leave it up to you... but this isn't to say that there are some Hapi-esque conventions. To address what you mentioned, yes, routes (by convention) are displaced into what Hapi calls "plugins." Forget their buzzword, it's just plain 'ole controllers ultimately.

Other unusual things you'll notice is that all modules that are require'd in Hapi are capitalized. There are a handful of these quirks that a Hapi 8 developer should be familiar with. You can find a brief layout of these kinda things written by the project maintainer (Eran Hammer): https://gist.github.com/hueniverse/a06f6315ea736ed1b46d

@jedireza
Copy link
Owner

jedireza commented Sep 4, 2015

Closing for now. The hapi docs are great and the reference I use.

@jedireza jedireza closed this as completed Sep 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants