simplified startup script to make it easier to deploy on my server
This commit is contained in:
3
main.go
3
main.go
@@ -25,8 +25,9 @@ import (
|
|||||||
var router *gin.Engine
|
var router *gin.Engine
|
||||||
var dsn string
|
var dsn string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
router = gin.Default()
|
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")
|
router.LoadHTMLGlob("templates/*.tmpl")
|
||||||
bootstrap.InitializeRoutes(router)
|
bootstrap.InitializeRoutes(router)
|
||||||
router.Run()
|
router.Run()
|
||||||
|
|||||||
8
main.sh
Normal file → Executable file
8
main.sh
Normal file → Executable file
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# WIP: Do not use this at the moment
|
||||||
if [ ./main & ]; then
|
if [ -e "main" ]; then
|
||||||
exit 0
|
./main.go &> /var/log/rawleyxyz/log
|
||||||
else
|
else
|
||||||
exit 1
|
go build "main.go" && ./main &> /var/log/rawleyxyz/log
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ import (
|
|||||||
|
|
||||||
type BlogPost struct {
|
type BlogPost struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
Url string `json:"url" gorm:"primaryKey"`
|
Url string `json:"url" gorm:"primaryKey"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Date string `json:"date"`
|
Date string `json:"date"`
|
||||||
Comments []Comment `gorm:"foreignKey:Id"`
|
Comments []Comment `gorm:"foreignKey:Id"`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user