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

Development server always sends 404 #9

Open
morgansimonsen opened this issue May 1, 2018 · 2 comments
Open

Development server always sends 404 #9

morgansimonsen opened this issue May 1, 2018 · 2 comments

Comments

@morgansimonsen
Copy link

Trying to run the development server always returns 404. The server is running, using the example command provided in README.md. I see the incoming GETs in the debug window, but browser always receives: 404 Not Found - OpenBttn Server. Have also tried entering the path to a file in the public/openbttn folder directly. Always same result. Using go 1.6.

@mafredri
Copy link
Owner

mafredri commented May 1, 2018

Hi, there is no endpoint at /, maybe that is why you're seeing 404?

You can see the available endpoints here:

http.HandleFunc("/", notFoundHandler)
http.HandleFunc("/socket", bttnSocketRedirectHandler(bttnIP))
http.HandleFunc("/test/", testHandler)
http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(http.Dir(publicPath))))
for _, f := range bttnRedirectFiles {
http.HandleFunc("/"+f, bttnRedirectHandler(bttnIP))
}
// Serve OTA files for the SPWF01SA Wi-Fi module.
http.HandleFunc("/ota/", otaHandler(otaPath))

Hope that helps! 😄

@mafredri
Copy link
Owner

mafredri commented May 1, 2018

So, e.g:

$ openbttn -public /path/to/openbttn/public
$ curl -vvv localhost:8774/public/openbttn/firstset.html

Should work.

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

2 participants