snapframework / snap

Top-level package for the official Snap Framework libraries, includes the snaplets API as well as infrastructure for sessions, auth, and templates.
http://snapframework.com/
BSD 3-Clause "New" or "Revised" License
455 stars 68 forks source link

Expose a default Heist config #164

Open cimmanon opened 8 years ago

cimmanon commented 8 years ago

The heistInit initializer creates routes for all of my templates. Problem is, I never want this behavior. If I define a route that happens to overlap with the routes generated by heistInit: the raw template is served instead of processing my handler. I'm more than happy to use heistInit', but I'm forced to recreate the same config for every Snap application I write (which is extra troublesome when the API for it changes).

Snap.Snaplet.Heist.Internal creates the exact config I'd like to use, but it's inaccessible because it's hidden inside of gHeistInit. Would it be possible to expose this config?

mightybyte commented 8 years ago

I'm conflicted about this. I see your point--I usually use heistInit' as well. Here are a few of the things I'm thinking:

Given all these points I think I'm currently leaning more towards leaving things as-is, but I'm still open to being convinced otherwise.