restify/node-restify

NotAuthorized when serving static files.

開放

#549 建立於 2014年3月5日

 (14 則留言) (0 個反應) (0 位負責人)JavaScript (983 個分叉)batch import
BugHelp WantedServe

倉庫指標

星標
 (10,695 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

I'm trying to serve a static index.html file and I think my code is correct but when I go to http://localhost/static I get:

{
  code: "NotAuthorized",
  message: "/static"
}

Is it an issue with the current changes that have been made to the static file serving JS or is it an issue with my code?

Route:

app.get(/\/static\/?.*/, restify.serveStatic({ 
    directory: "./",
    default: "index.html"
}));

貢獻者指南