I have a problem with sending data on the server. I run server.js in node but always after clicking submit button req.body.username and req.body.password is undefinied... HTML file is opened in a browser, so probably it is the problem, but I have no idea how to solve it. I'm a beginner so be understanding...
index.html:
<form method="post" action="http://127.0.0.1:3000/">   
<fieldset>
<label for="username"></label>
<input type="text" id="username" placeholder="username">
<label for="password"></label>
<input type="password" id="password" placeholder="password">
<input type="submit" value="Create user">
</fieldset>
</form>
server.js:
 const express = require('express');
 const mysql = require('mysql');
 const bodyParser = require('body-parser');
 const http = require('http');
 const template = require('./template'); 
 const app = express();
 app.use(bodyParser.urlencoded({extended:true}));
 app.use(express.static('public'))
 app.use(bodyParser());
 app.post('/',(req, res) => {
  template.createUser( 
    req.body.username,
    req.body.password
  )
 });
 app.listen(3000, 'localhost' );
 
    