mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 11:39:17 +00:00
24 lines
487 B
Go
24 lines
487 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
app "databag/internal"
|
|
"databag/internal/store"
|
|
"github.com/gorilla/handlers"
|
|
)
|
|
|
|
func main() {
|
|
|
|
store.SetPath("/var/lib/databag/databag.db");
|
|
|
|
log.Printf("Server started")
|
|
|
|
router := app.NewRouter()
|
|
|
|
origins := handlers.AllowedOrigins([]string{"*"})
|
|
methods := handlers.AllowedMethods([]string{"GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS"})
|
|
|
|
log.Fatal(http.ListenAndServe(":7000", handlers.CORS(origins, methods)(router)))
|
|
}
|