Timeout setup procedure for a long running api calls globally in node js express js

I have this code in the parent directory.

const express=require('express');
const app=require('./app')
const http=require('http');
const bodyParser=require('body-parser');
const cookieParser=require('cookie-parser');
const dotenv=require('dotenv');
const ConnectToDb=require('./config/db-connection');
const register=require('./api/routes/auth');
const errorHandler = require('./api/middlewares/errorHandler');

//setting .env file variables
const PORT=process.env.PORT || 5001;
const server=http.createServer(app);
//Server Time out

        console.log(`Listening on port ${PORT}`);


How can i setup the server timeout.If the api call is more than 5s it should stop the request and mention server timed out.