ExpressJS: Adding routes dynamically at runtime

I want to be able to add new routes at runtime without restarting the server with NodeJS & ExpressJS. I made a similiar approach like in this article: https://alexanderzeitler.com/articles/expressjs-dynamic-runtime-routing/Technically I’m able to add new files and logic at runtime likewise in the article, but the problem is that when no api route was matched I’ll send a 404 JSON respond (as it is supposed to be). I think the problem that I’m having is that my dynamically created routes are never reached, because static routes have priority over dynamically created routes. This means that the created routes will be mounted

ExpressJS: Adding routes dynamically at runtime

I want to be able to add new routes at runtime without restarting the server with NodeJS & ExpressJS. I made a similiar approach like in this article: https://alexanderzeitler.com/articles/expressjs-dynamic-runtime-routing/Technically I’m able to add new files and logic at runtime likewise in the article, but the problem is that when no api route was matched I’ll send a 404 JSON respond (as it is supposed to be). I think the problem that I’m having is that my dynamically created routes are never reached, because static routes have priority over dynamically created routes. This means that the created routes will be mounted