I keep annoyingly on finding examples that only parse JSON sent. I am trying to find an example where a POST comes from a form.
<form class="form-horizontal" role="form" action="/" method="post">
<input type="text" class="form-control" name="email" placeholder="your@email.here">
<input type="text" class="form-control" name="password" placeholder="password">
<button type="submit" class="btn btn-default">Sign in</button>
</form>
As you can see i have fields email
and password
. I am using koa-router
which boasts express style routing but this isn't working:
.post('/', function* () {
console.log(this.body.email); // <--- undefined
console.log(this.body.password);
})