Expressjs route param as variable in main app
- by MoDFoX
For my app I have two route set up,
app.get('/', routes.index);
app.get('/:name', routes.index);
I would like it to be so that if I don't specify a param, say just go to appurl.com (localhost:3000), it would load a default user, but if I do specify a param(localhost:3000/user), use that as the variable "username" in the following function…