Skip to content

Commit 438489b

Browse files
committed
chore: add a simple http server.
Usage: $ make $ ./my-country & $ curl http://127.0.0.1:8080 ok
1 parent 7f6896a commit 438489b

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
my-country

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.PHONY: build fmt clean
2+
3+
build:
4+
go build -o my-country .
5+
6+
fmt:
7+
gofmt -s -d .
8+
gofmt -s -d -w .
9+
10+
clean:
11+
rm my-country

main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package main
2+
3+
import "net/http"
4+
5+
func main() {
6+
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
7+
w.Write([]byte("ok"))
8+
})
9+
http.ListenAndServe(":8080", nil)
10+
}

0 commit comments

Comments
 (0)