I am a beginner in NodeJS and am responsible for a project in this tool. I'm using the "EJS" engine to create the views. I created a form to send the information entered by the user to a route, on this route I want to process the information and return a response to the view, but I do not know how to proceed with the implementation. Here is the code for the view and the routes created so far.
artwork_1.ejs
<html>
<head>
<title>Página de Conversação</title>
<link rel='stylesheet' href='/stylesheets/style.css' />
</head>
<body>
<h3><%= artwork %></h3>
<img src="images/IMG01.jpg" alt="Imagem da Obra de Arte 1" title="Obra de Arte 1"></br>
<form>
<input type="text" name="question" placeholder="Pergunte-me" required />
<button>Enviar</button>
</form>
</body>
</html>
index.js
const express = require('express');
const router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: "Página Inicial" });
});
router.get('/artwork-1', function(req, res){
res.render('artwork_1', { artwork: "Obra 1" });
});
module.exports = router;