Skip to content

Commit

Permalink
Initial Base
Browse files Browse the repository at this point in the history
  • Loading branch information
celestix committed Aug 6, 2022
1 parent 5153a55 commit 3ed793d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/gigauserbot/gigafeed

go 1.18
27 changes: 27 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package main

import (
"fmt"
"io/ioutil"
"net/http"
"time"
)

func main() {
mux := http.NewServeMux()
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
b, err := ioutil.ReadAll(r.Body)
if err != nil {
fmt.Println("en error occured:", err.Error())
return
}
fmt.Println(string(b))
})
server := &http.Server{
Addr: "0.0.0.0:3455",
Handler: mux,
ReadTimeout: time.Second * 2,
}
server.ListenAndServe()
}

0 comments on commit 3ed793d

Please sign in to comment.