Last active
January 10, 2017 19:07
-
-
Save JamesDaniel/175fb6700f700f1510065d34d6c7f8d4 to your computer and use it in GitHub Desktop.
node REST end point with ID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.get('/user/:uid/files/*', function(req, res){ | |
var uid = req.params.uid, | |
path = req.params[0] ? req.params[0] : 'index.html'; | |
res.sendfile(path, {root: './public'}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment