Skip to content

Commit 10c145e

Browse files
committed
Initial Commit
0 parents  commit 10c145e

4 files changed

Lines changed: 24 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.odo/env
2+
.odo/odo-file-index.json
3+
main

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# devfile-stack-go
2+
3+
A starter project for go

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/schultzp2020/devfile-starter-projects/go
2+
3+
go 1.16

main.go

Lines changed: 15 additions & 0 deletions
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("0.0.0.0:8080", nil)
11+
}
12+
13+
func HelloServer(w http.ResponseWriter, r *http.Request) {
14+
fmt.Fprintf(w, "Hello, %s!", r.URL.Path[1:])
15+
}

0 commit comments

Comments
 (0)