serving static files with restify (node.js)

后端 未结 3 1725
臣服心动
臣服心动 2021-02-02 10:35

I have the following code:

app.js

[...]

server.get(/\\/docs\\/public\\/?.*/, restify.serveStatic({
  directory: \'./public\'
}));

server.listen(1337, f         


        
3条回答
  •  孤城傲影
    2021-02-02 11:08

    restify will use the directory option as a prefix for the entire route path. In your case, it will look for ./public/docs/public/index.html.

提交回复
热议问题