I have the following code:
app.js
[...]
server.get(/\\/docs\\/public\\/?.*/, restify.serveStatic({
directory: \'./public\'
}));
server.listen(1337, f
directory
option is a prefix for your entire path.The solution now becomes:
server.get(/\/docs\/public\/?.*/, restify.serveStatic({
directory: __dirname
}));
And then your static files will need to be in ./docs/public
.
(__dirname
is a global variable that contains the absolute path of the script you are running)