Closed tj closed 12 years ago
Glad your enjoying it, and feel free to send through any suggestions or thoughts on the code.
Creating an app without passing in a function is a nice addition, certainly feels a lot closer to express, which is a Good Thing™.
yup! so far so good. I did notice one thing that may be more of a gotcha than anything else, but if you POST and then navigate back, you'll get that POST again, so for the todo list you just keep adding items to the list while pressing back. I imagine it's the same for DELETE etc which could be a little weird
I think the handling of non GET requests is correct, it matches what would happen on the server. If you do a POST and the server doesn't redirect then navigating with the back/forward buttons will re-submit the same request.
With Davis this is the same, if in your route handler you do not perform a redirect then the POST request will still be in the history, the preferred pattern is to redirect in your POST request handler
app.post('/foo', function (req) {
// app logic here
req.redirect('/bar')
})
that's true, though a browser will (usually?) warn you, but maybe that's work a plugin should take care of
added a tiny todo list example, and allowing
Davis()
as a short-cut to create an app. nice work man, pretty fun to use so far. I'm just going to poke around and send over any suggestions I can come up with while playing with examples