mirror of
https://github.com/status-im/fathom.git
synced 2025-02-28 19:10:36 +00:00
25 lines
529 B
Go
25 lines
529 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/dannyvankooten/ana/core"
|
|
"github.com/dannyvankooten/ana/api"
|
|
)
|
|
|
|
// TODO: Use Gorilla Mux router.
|
|
// TODO: Authentication.
|
|
|
|
func main() {
|
|
db := core.SetupDatabaseConnection()
|
|
defer db.Close()
|
|
|
|
// register routes
|
|
api.RegisterRoutes()
|
|
http.HandleFunc("/collect", api.CollectHandler)
|
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
|
http.ServeFile(w, r, "./static/" + r.URL.Path[1:])
|
|
})
|
|
http.ListenAndServe(":8080", nil)
|
|
}
|