Functionally done!

This commit is contained in:
Mariano Uvalle 2023-11-10 07:48:11 +00:00
parent 426500df45
commit 7bcdd2dd80
10 changed files with 219 additions and 33 deletions

View file

@ -11,14 +11,20 @@ import (
func main() {
privateKeyPath := os.Getenv("CCCLIP_PRIVATE_KEY")
publicKeyPath := os.Getenv("CCCLIP_PUBLIC_KEY")
databaseLocation := os.Getenv("CCCLIP_DATABASE_LOCATION")
port := os.Getenv("CCCLIP_PORT")
if publicKeyPath == "" || privateKeyPath == "" {
log.Fatalf("both public and privae keys must be provided")
log.Fatalf("database location and public and privae keys must be provided")
}
config.Default.PrivateKeyPath = privateKeyPath
config.Default.PublicKeyPath = publicKeyPath
config.Default.DatabaseLocation = databaseLocation
port := "8080"
if port == "" {
port = "8080"
}
log.Printf("Serving on port %s", port)
s := server.New(":" + port)
log.Fatal(s.ListenAndServe())