I'm using ExpressJS 4.x to develop a REST web server. What I'm trying to do is to write a middleware that catches all the incoming requests, except the ones that begin with "/api/..."
Which regular expression can I use?
//This middleware catches everything except the requests addressed to "/api/..."
app.use('<regular_expression>',express.static('public'));
//Not intercepted by the middleware
app.get("/api/foo1",function(req,res)=>{
......
})
//Not intercepted by the middleware
app.get("/api/foo2/bar",function(req,res)=>{
......
})