I would like to create a route that allows for any four digit number to be passed into the URL (www.site.com/3434). I've been unable to figure this out from the express docs and am just learning it for the first time.
I pieced together something based on google searches, but it isn't correct and I don't have enough regex knowledge yet.
app.get(/^[0-9]{4,4}$/, function(req, res){
res.render('mobile');
});
Any help would be appreciated.
You probably want this:
app.get('/:id([0-9]{4})', function(req, res){
res.render('mobile');
});