Skip to content

Commit

Permalink
Refactored example file
Browse files Browse the repository at this point in the history
  • Loading branch information
ichtrojan committed Jan 8, 2020
1 parent dd09ec1 commit c8f6b88
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 31 deletions.
27 changes: 0 additions & 27 deletions example/json.go

This file was deleted.

19 changes: 15 additions & 4 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,36 @@ package main

import (
"fmt"
"log"
"net/http"

"github.com/ichtrojan/thoth"
)

func main() {
logger := thoth.Init("log")
json, err := thoth.Init("json")

if err != nil {
fmt.Println(err)
}

file, err := thoth.Init("log")

if err != nil {
fmt.Println(err)
}

http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
_, err := fmt.Fprintf(w, "Hello, Testing from Thoth")

if err != nil {
log.Fatal(err)
json.Log(err)
}

fmt.Println("Endpoint served")
})

if err := http.ListenAndServe(":8888", nil); err != nil {
logger.Log(err)
json.Log(err)
file.Log(err)
}
}

0 comments on commit c8f6b88

Please sign in to comment.