'How do I block routes from a certain origin with cors and expressjs

Right now I have enabled cors so it only allows one origin that can make a request to ANY ROUTE, but I want to make it so it also blocks some routes for that one origin. If their is any way, please answer this question! Thank you.

So far my code is

app.use(cors({
  origin: process.env.HOST,
}));


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source