24 lines
435 B
Go
24 lines
435 B
Go
// main.go
|
|
package main
|
|
|
|
import (
|
|
"gitea.ghost.tel/knight/library/database"
|
|
"gitea.ghost.tel/knight/library/handlers"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func main() {
|
|
// Initialize the database
|
|
database.ConnectDatabase()
|
|
|
|
// Create a Gin router
|
|
router := gin.Default()
|
|
|
|
// Define routes
|
|
router.GET("/api/books", handlers.GetBooks)
|
|
router.GET("/api/books/search", handlers.SearchBooks)
|
|
|
|
// Start the server
|
|
router.Run(":8080")
|
|
}
|