add v1 GET endpoints

This commit is contained in:
Stanislaw
2022-12-25 23:14:45 +01:00
parent 3f17d6e985
commit 92ece902f7
12 changed files with 258 additions and 33 deletions

25
database/connection.go Normal file
View File

@@ -0,0 +1,25 @@
package database
import (
"os"
"gorm.io/driver/postgres"
"gorm.io/gorm"
)
var DB *gorm.DB
var err error
func CreateConnection() {
DB, err = gorm.Open(postgres.Open(os.Getenv("DATABASE_URL")), &gorm.Config{})
if err != nil {
panic("failed to connect database")
}
DB.AutoMigrate(
&Quote{},
&QuoteLine{},
&Image{},
&Admincard{},
&Splash{})
}