We're live-coding on Twitch! Join us!

We'll be creating a form that we can process using our Node/Express routes.

We need to bring in body-parser using:

npm install --save body-parser

Then we can use that in server.js with:

// grab it
var bodyParser = require('body-parser');

// configure it
app.use(bodyParser.urlencoded({ extended: true }));

For quick access, here's the content of the create event form:

<form action="/events/create" method="POST">

    <div class="form-group">
        <input type="text" name="name" class="form-control">

    <div class="form-group">
        <textarea name="description" rows="5" class="form-control"></textarea>

    <div class="form-group">
        <button type="submit" class="btn btn-success btn-lg">Create</button>


Like this article? Follow @chrisoncode on Twitter