A microservice is a small service that does one business thing and can be deployed independently. It usually owns its data and talks to other services via APIs/events, so it can scale and release separately.
const express = require('express');
const app = express();
const port = 3000;
app.get('/users', (req, res) => {
res.json([{ id: 1, name: 'Alice' }]);
});
app.listen(port, () => {
console.log(`Microservice listening at http://localhost:${port}`);
});