-
Notifications
You must be signed in to change notification settings - Fork 194
Open
Description
I was trying to use Ecstatic (via http-server) to serve Angular's ES2015 modules. This means serving with .js default extension. I had problems because they have some files named e.g. metadata.js that also have a corresponding directory with the same name. Attempting to import ./metadata resolves to the directory, but since there is no index.js inside it, and showDir is false, this results in a 404. In this case, I think Ecstatic should fall back to serving the document with the default extension, if one exists.
I.e the proposed logic would be this:
- If a file with the exact path exists: Serve it.
- Else if a directory with the exact path exists:
- If the directory has an index document: Serve it.
- Else if the
showDir: true: Show file list.
- Else if a file with default extension exists: Serve it.
- Else if 404.html exists: Serve it.
- Else serve 404.
Metadata
Metadata
Assignees
Labels
No labels