Skip to content

Commit

Permalink
err hand
Browse files Browse the repository at this point in the history
  • Loading branch information
Ujstor committed May 8, 2024
1 parent 6eba89c commit 9a94047
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
workflows: ["continuous integrationt"]
branches:
- main
- master
types:
- completed

Expand Down
12 changes: 10 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
package main

import (
"log"
"net/http"
)

func handler(w http.ResponseWriter, r *http.Request) {
html := `<html><head><title>Test1</title></head><body><h1>Welcome to Test1</h1></body></html>`
w.Write([]byte(html))
_, err := w.Write([]byte(html))
if err != nil {
http.Error(w, "Error writing response", http.StatusInternalServerError)
return
}
}

func main() {
http.HandleFunc("/", handler)

http.ListenAndServe(":8088", nil)
err := http.ListenAndServe(":8088", nil)
if err != nil {
log.Fatalf("Error starting server: %s", err)
}
}

0 comments on commit 9a94047

Please sign in to comment.