I am trying to match a URL that starts with /user/ and ends with any number and slash.
example:
/user/345/
I tried /user/\d{3}, but the interpreter gives me an error at \d.
if (request.url == '/') {
absPath = './public/index.html';
serveStatic(response, cache, absPath);
} else if (request.url.match(/user/\d{3})) {}
any suggestions?
/. Which means you'll need to escape yours :/\/user\/\d+\//