so here is the very simple version that just stores and returns and nothing else.
Btw: I used the node.js standard of spaces for tabs. You might want to consider switching to that as well.
Added very simple registry
That looks cool, but I was wondering what use-cases you had in mind for the registry. How would people use it, and why is it needed for an MVC project?
For making all kinds of stuff easily accessible for all controllers without the need of endless requiring.
Pretty much every MVC framework i've worked with had one and I was lacking a mechanism like that anyways.
For example if you have a function that is used in several places throughout your controllers but doesn't belong in any of your models, you can put it in the registry and then retrieve it in the controller whenever you need it.
Ah, I see. For that purpose, I had added support for Helpers, just like CodeIgniter has. Would you and other users prefer to also have a registry that you can put your own stuff in? Or do you think Helpers would be good enough?
I just wanna make sure that functionality that we add is necessary functionality, to keep the project lightweight.
Well you can also use a registry for things like configuration or setting application states and such.
But I see what you mean and it's totally up to you whether you want to include this functionality or not.
Configuration is an important feature, which I agree cannot be achieved by Helpers only. I think the registry functionality would be better named Configurations, so that users can store plain values in it and store commonly used functions in Helpers. That way, both features will have specific use-cases, and their functionality won't overlap.
What do you think?
Sounds good. Just renaming registry to configuration then. Should I do it or will you do it together with the helpers?
If we're going to call it configurations instead, do you think we should just have it used as Ni.configurations('test', "word") and res.ok("Hello" + Ni.configurations('test') + "!")? That might be more clear, especially since we won't be storing functions in it anyway.
res.ok("Hello" + Ni.configurations('test') + "!")
Yeah, the example would have to be changed too.
To be honest I just put it there to make sure that it works. :D
Okay, you can change your registry and send another pull request. I've already added Helpers functionality, and I'll add documentation for it and Libraries onto the README soon.
Done and closed. :)