Here is my server.js:
const express = require('express');
const app = express();
const subdomain = require('express-subdomain');
app.use(subdomain('api', (req, res, next) => {
console.log('Welcome to the API');
next();
}));
app.listen(port, () => console.log('server is online...'));
And I send a post request to the subdomain route:
'https://api.example.com/'
But the code never reaches the console.log('Welcome to the API');
What I'm doing wrong ?