-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
41 lines (33 loc) · 789 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package main
import (
"log"
"net/http"
"github.com/gorilla/mux"
)
func init() {
initializeFirebase()
err := initializeFirebase()
if err != nil {
log.Fatalf("Failed to initialize Firebase: %v", err)
}
}
func main() {
// Load configuration
config, err := LoadConfig("config.json")
if err != nil {
log.Fatalf("could not load config: %v", err)
}
router := mux.NewRouter()
// Serving static files
fs := http.FileServer(http.Dir("assets"))
router.PathPrefix("/assets").Handler(http.StripPrefix("/assets", fs))
// Set up authentication routes
AuthHandler(router, config)
MainHandler(router)
DriveHandler(router)
log.Println("listening on localhost:8080")
err = http.ListenAndServeTLS(":8080", "cert.pem", "key.pem", router)
if err != nil {
log.Fatal(err)
}
}