Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to serve files from a folder with an index.html file #146

Closed
Hilzu opened this issue Mar 24, 2017 · 3 comments
Closed

Unable to serve files from a folder with an index.html file #146

Hilzu opened this issue Mar 24, 2017 · 3 comments

Comments

@Hilzu
Copy link

Hilzu commented Mar 24, 2017

I created a new project using create-react-app and tried to host the built files using serve as is recommended by create-react-app. I was unable to make it work and tried to figure why. It seems that serve is unable to serve any files when serving a directory with an index.html file. Here's the steps that I used to verify this:

$ node --version
v7.7.4
$ npm --version
4.4.1
$ serve --version
5.1.0
$ mkdir build
$ echo '<!doctype html><title>.</title>' > build/index.html
$ serve build

# In a different terminal
$ http localhost:5000
HTTP/1.1 204 No Content
$ rm build/index.html
$ http localhost:5000
HTTP/1.1 200 OK

The response seems to always be 204 for all existing files no matter what I do. I'm using macOS 10.12.3.

@Hilzu Hilzu changed the title Unable to serve root of folder with an index.html file Unable to serve files from a folder with an index.html file Mar 24, 2017
@lachlanjc
Copy link
Contributor

Having the same issue here.

@leo
Copy link
Contributor

leo commented Mar 25, 2017

Have you checked it in the browser? I mean, the status codes might be wrong but that doesn't imply that it's not working...?

@waterelder
Copy link

I have the same issue.

@leo leo closed this as completed in d24bda5 Mar 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants