🎉 initial commit

This commit is contained in:
2021-01-13 23:39:00 +01:00
commit 8e9cbe797c
9 changed files with 161 additions and 0 deletions

38
main.go Normal file
View File

@@ -0,0 +1,38 @@
package main
import (
"fmt"
"log"
"net/http"
"os"
)
func main() {
fmt.Println("OAuth RCA")
if err := run(); err != nil {
fmt.Fprintf(os.Stderr, "%s)\n", err)
os.Exit(1)
}
}
func run() error {
srv := newServer()
srv.store = &dbStore{}
err := srv.store.Open()
if err != nil {
return err
}
defer srv.store.Close()
http.HandleFunc("/", srv.serveHTTP)
port := 8080
log.Printf("servering http port %v", port)
err = http.ListenAndServe(":8080", nil)
if err != nil {
return err
}
return nil
}