restify/node-restify

NotAuthorized when serving static files.

Open

#549 geöffnet am 5. März 2014

Auf GitHub ansehen
 (14 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (10.695 Stars) (983 Forks)batch import
BugHelp WantedServe

Beschreibung

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"
}));

Contributor Guide