Without using the Node.js express module, can I read two POST data variables using https module?
I have this code working fine, only that I need to get two POST request values (license and photo) from the request. How do I extract two parts from the POST request?
const https = require('https');
const fs = require('fs');
const options = {
    secure: true,
    key: fs.readFileSync('ssl/key.pem'),
    cert: fs.readFileSync('ssl/public.pem'),
    ca: fs.readFileSync('ssl/cap1_led_com.ca-bundle')
};
https.createServer(options, function (req, res)
    {
        let body = '';
        if (req.method === 'GET' && req.url === '/')
            {
                res.writeHead(200, {'Content-Type': 'text/html'});
                fs.readFile('./http-form.html', 'UTF-8', (err, data) => {
                    if (err)
                        throw err;
                    res.write(data);
                    res.end();
                });
            }
        else if (req.method === 'POST')
            {
                req.on('data', (data) => {
                    body += data;
                });
                req.on('end', () => {
                    res.writeHead(200, {'Content-Type': 'text/html'});
                    res.write(body, () => {
                        res.end();
                    });
                });
            }
        else
            {
                res.writeHead(404, {'Content-Type': 'text/html'});
                res.end(`<h1>404 ERROR could not find that Page</h1>`);
            }
    }).listen(443);
