Merge branch 'dev' of ssh://meowgit.nekoea.red:22222/nihonium/nyanimedb into dev
This commit is contained in:
commit
7e6520c931
49 changed files with 1551 additions and 115 deletions
|
|
@ -13,7 +13,7 @@ import (
|
|||
|
||||
"github.com/gin-contrib/cors"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
)
|
||||
|
||||
|
|
@ -31,17 +31,17 @@ func main() {
|
|||
// log.Fatalf("Failed to init config: %v\n", err)
|
||||
// }
|
||||
|
||||
conn, err := pgx.Connect(context.Background(), os.Getenv("DATABASE_URL"))
|
||||
pool, err := pgxpool.New(context.Background(), os.Getenv("DATABASE_URL"))
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
defer conn.Close(context.Background())
|
||||
defer pool.Close()
|
||||
|
||||
r := gin.Default()
|
||||
|
||||
queries := sqlc.New(conn)
|
||||
queries := sqlc.New(pool)
|
||||
|
||||
server := handlers.NewServer(queries)
|
||||
// r.LoadHTMLGlob("templates/*")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue