Create a CRUD App with Node and MongoDB: Lesson 13 of 17

Creating Events

Up Next

Showing Success Messages

Autoplaying in 7 seconds!


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:

Table of Contents

    // 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>

    Chris Sevilleja

    176 posts

    Founder of Google Developer Expert in Web Technologies. Slapping the keyboard until something good happens.