Cannot POST / error using express
<p>I am trying to create a simple form handler using express. I tried the code below for my form:</p>

<pre><code>&lt;form class="form"  action="/" method="post" name="regForm"&gt;              
    &lt;div class="form-group"&gt;
        &lt;input type="text" name="username" class="form-control" id="username" placeholder="Username"&gt;
    &lt;/div&gt;
    &lt;button type="submit" class="btn btn-default"&gt;Submit&lt;/button&gt;
&lt;/form&gt;
</code></pre>

<p>And here is my app.js code:</p>

<pre><code>const port = 3000;

var express = require('express'),
    app = express(),
    server = require('http').createServer(app);
var bodyParser = require('body-parser');

app.use(express.static(__dirname + '/public'));

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

app.use(bodyParser.json());

app.post('/',function(req,res){
   var username = req.body.username;
   var html = 'Hello:' + username;
   res.send(html);
   console.log(html);
});

server.listen(port);
</code></pre>

<p>I keep getting the error "CANNOT POST /" after submitting the form. Am I missing something like a module? </p>