Node Restify Error: Wildcard must be the last character in the route While tring to serve static files

71 Views Asked by At

I was able to serve static files with the following code till node 16 restify 9.0.0.

var staticFiles = "*.(html|js|css|jpg|gif|png|eot|svg|woff2|ttf|wotf|ico)";
server.get(staticFiles, restify.plugins.serveStaticFiles(path.resolve(deploymentRoot, "../wwwroot/web/path")));

But upgrading to node 20 and restify 11.1.0 getting the error

Error: Wildcard must be the last character in the route
0

There are 0 best solutions below