Skip to content

Commit fc262c6

Browse files
author
Nikolaos Dalalelis
committed
initial commit
1 parent 5ef5bb6 commit fc262c6

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

README.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
11
# helloworld-go
2-
Hello world go
2+
3+
Simple hello world go web application
4+
5+
## Build
6+
7+
```bash
8+
go build
9+
```
10+
11+
## Run
12+
13+
```bash
14+
./helloworld-go
15+
```
16+
17+
## Test
18+
19+
```bash
20+
$ curl localhost:8080/
21+
Go is the best language in the world
22+
```

main.go

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"net/http"
6+
)
7+
8+
func main() {
9+
http.HandleFunc("/", HelloServer)
10+
http.ListenAndServe(":8080", nil)
11+
}
12+
13+
func HelloServer(w http.ResponseWriter, r *http.Request) {
14+
fmt.Fprintf(w, "Go is the best language in the world\n")
15+
}

0 commit comments

Comments
 (0)