restify/node-restify

NotAuthorized when serving static files.

Open

#549 ouverte le 5 mars 2014

Voir sur GitHub
 (14 commentaires) (0 réactions) (0 assignés)JavaScript (983 forks)batch import
BugHelp WantedServe

Métriques du dépôt

Stars
 (10 695 stars)
Métriques de merge PR
 (Merge moyen 3h 56m) (2 PRs mergées en 30 j)

Description

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

Guide contributeur