outmoded / university

Community learning experiment
Other
371 stars 194 forks source link

Refine and clarify, then share :) #224

Closed eriktrom closed 8 years ago

eriktrom commented 8 years ago

Refine and clarify code having to do with use of glue, testing and logging

This PR contains more than one concern. It is also based off of assignment 8. It may therefore not be something to merge as is. If there is interest in one or more parts, I don't mind picking this apart according to feedback. Fyi.

Loose Notes:

As I saw such things I made an attempt to clarify them. The changes are all benign meaning there is no new functionality, just code re-organization.

Feel free to use what seems useful or the whole branch in further assignments/refactors.

Thanks for the awesome example btw. Without it I would never starting using Hapi all those months ago.

eriktrom commented 8 years ago

PS - the pattern for cleaning up the log file after tests runs seems like it could be cleaner. Open to feedback.

zoe-1 commented 8 years ago

Really nice work :-) Looked at your PR some today and appreciate what you have done.
Over the next couple days will provide more feedback and interaction. Cheers!

eriktrom commented 8 years ago

@zoe-1 no rush - i'll be OOO till the 1st so take ur time

zoe-1 commented 8 years ago

@eriktrom I have been looking over your work. In general, I like all improvements you made. Very nice work! However, in respect to __dirname versus process.cwd() I have a few thoughts.

Any thoughts?

Lately, in my use of hapi I have been trying not to write big monolithic apps but instead writing a bunch of little apps / processes that talk to each other. Using process.cwd() would not work well for me because it would stop my ability to use a script to restart multiple services at the same time.

In respect to writing multiple little apps that talk to each other, I found this video by @substack interesting. Perhaps, you will like it. I think hapi and nodejs really shine when building many small apps / services that talk to each other. And, hapi's h2o2 is really powerful for building proxies that consume multiple services. npmjs' CTO @seldo gives a good talk on nodejs and SOA service oriented architecture here. note: npmjs uses hapijs.

Anyhow, I don't think using process.cwd() or __dirname is really that important of an issue. Every project has it's own unique needs. Depending on the context one or the other would work fine. Just trying to share some meaningful feedback after you shared your meaningful work.