I would like to be able to redirect a site to a url that is a result of a database call.
How would this behave exactly? What happens if the result is null?
also would need to specify which field name of the document being returned holds the url. seems like it isn't a good fit for express-mongoose to me.
I was thinking more of using it in conjunction with static methods. For example, in a document, I have a URL split up by server and path. I would then call:
where in that static call a promise is returned and resoloved by a full url path.
ok, so if the result is null, just pass to next() like with render/send?
Not really familiar with that... never tried passing null to those. I would just expect some sort of error though, right?
Does this seem like a good idea?
Upon null we should probably next(new Error('URL expected')). I'm down for adding this
next(new Error('URL expected'))
add res.redirect support
available in 0.0.5 on npm
Awesome! Thanks for doing that.
Thank you for the idea :)