You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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:
The response seems to always be
204
for all existing files no matter what I do. I'm using macOS 10.12.3.The text was updated successfully, but these errors were encountered: