Sets up and initializes database for freed (SQLite)
This commit is contained in:
parent
6f79f255d9
commit
23e29c44f4
5 changed files with 221 additions and 1 deletions
12
main.go
12
main.go
|
|
@ -1,14 +1,26 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"freed/internal/database"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
_, err := database.New("./freed.db")
|
||||
|
||||
if err != nil {
|
||||
log.Fatalf("Could not initialize database: %v", err)
|
||||
}
|
||||
|
||||
r := gin.Default()
|
||||
|
||||
// Middlewares
|
||||
r.Use(gin.Recovery())
|
||||
|
||||
// Routes
|
||||
r.GET("/status", func(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"application": "freed",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue