hapi icon indicating copy to clipboard operation
hapi copied to clipboard

More examples, for example, forms

Open kokujin opened this issue 13 years ago • 3 comments

Hi there!

I just found Hapi, from what I gathered on the net, there is no need for a BodyParser middleware as in Express/connect

app.use(express.bodyParser());

How is this handled in Hapi? Is there an eyample somehwere that I can look at?

Thanks

kokujin avatar Jun 05 '13 10:06 kokujin

In https://github.com/spumko/hapi/blob/master/docs/Reference.md#route-options read the payload option.

By default, if you add a POST route, the payload will be parsed if it is text, json, or form-encoded.

hueniverse avatar Jun 05 '13 15:06 hueniverse

@kokujin - A couple of unofficial examples with POST are here https://github.com/wpreul/hapi-example/

Mine also has various sample browser side code too https://github.com/paullang/hapi-post-example/

paullang avatar Jul 02 '13 04:07 paullang

Added server example to hapi: https://github.com/spumko/hapi/pull/985 and tutorial to hapijs.com

Also, if you look at the cookie example it shows how to submit and read a form.

geek avatar Jul 18 '13 20:07 geek