simplified startup script to make it easier to deploy on my server
This commit is contained in:
1
main.go
1
main.go
@@ -27,6 +27,7 @@ var dsn string
|
||||
|
||||
func main() {
|
||||
router = gin.Default()
|
||||
// This needs to change because of RCCTL in OpenBSD, not sure if you can use a ksh variable as path in Gin but i'll test
|
||||
router.LoadHTMLGlob("templates/*.tmpl")
|
||||
bootstrap.InitializeRoutes(router)
|
||||
router.Run()
|
||||
|
||||
8
main.sh
Normal file → Executable file
8
main.sh
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ./main & ]; then
|
||||
exit 0
|
||||
# WIP: Do not use this at the moment
|
||||
if [ -e "main" ]; then
|
||||
./main.go &> /var/log/rawleyxyz/log
|
||||
else
|
||||
exit 1
|
||||
go build "main.go" && ./main &> /var/log/rawleyxyz/log
|
||||
fi
|
||||
|
||||
@@ -22,8 +22,8 @@ import (
|
||||
|
||||
type BlogPost struct {
|
||||
gorm.Model
|
||||
Url string `json:"url" gorm:"primaryKey"`
|
||||
Title string `json:"title"`
|
||||
Date string `json:"date"`
|
||||
Url string `json:"url" gorm:"primaryKey"`
|
||||
Title string `json:"title"`
|
||||
Date string `json:"date"`
|
||||
Comments []Comment `gorm:"foreignKey:Id"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user