Skip to content
Snippets Groups Projects
Commit f410ad46 authored by gbe's avatar gbe
Browse files

Remove server killing debug handler

parent 8004ead9
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,6 @@ import ( ...@@ -6,7 +6,6 @@ import (
"html/template" "html/template"
"log" "log"
"net/http" "net/http"
"os"
"strconv" "strconv"
"github.com/jmoiron/sqlx" "github.com/jmoiron/sqlx"
...@@ -34,17 +33,6 @@ func main() { ...@@ -34,17 +33,6 @@ func main() {
http.Handle("/static/", http.FileServer(http.FS(staticFS))) http.Handle("/static/", http.FileServer(http.FS(staticFS)))
http.HandleFunc("/debug/quit", func(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
http.Error(w, "invalid method:"+r.Method, http.StatusMethodNotAllowed)
return
}
log.Println("exit requested by", r.RemoteAddr)
os.Exit(0)
})
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
log.Println("handling", r.Method, r.URL, "from", r.RemoteAddr) log.Println("handling", r.Method, r.URL, "from", r.RemoteAddr)
......
...@@ -23,9 +23,5 @@ ...@@ -23,9 +23,5 @@
</table> </table>
<p>And a bit of foo.</p> <p>And a bit of foo.</p>
<hr/>
<form method="POST" action="/debug/quit">
<button type="submit">Kill server</button>
</form>
</body> </body>
</html> </html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment