Skip to content

Commit

Permalink
day023 first webservice in Go
Browse files Browse the repository at this point in the history
  • Loading branch information
sebkraemer committed Dec 3, 2021
1 parent 948570c commit 232c7d9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions day023/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Log of day 23

First http servce with Go.

screenshot-hello-friends.png![grafik](./screenshot-hello-friends.png)
3 changes: 3 additions & 0 deletions day023/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/sebkraemer/100-days-of-code/day023

go 1.17
Binary file added day023/screenshot-hello-friends.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions day023/webservice.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package main

import (
"log"
"net/http"
)

func main() {
hw := func(w http.ResponseWriter, _ *http.Request) {
w.Write([]byte("hello #100DaysOfCode friends 👋"))
}
http.HandleFunc("/", hw)
err := http.ListenAndServe(":5000", nil)
if err != nil {
log.Fatal(err)
}
}

0 comments on commit 232c7d9

Please sign in to comment.