Implement saving and loading for account data, currently a basic json file

This commit is contained in:
Marc Di Luzio 2020-05-31 19:15:57 +01:00
parent f1e6311366
commit 179dd3f984
11 changed files with 306 additions and 130 deletions

View file

@ -1,34 +0,0 @@
package main
import (
"flag"
"fmt"
"os"
"os/signal"
"syscall"
"github.com/mdiluz/rove/pkg/server"
)
var port = flag.Int("port", 8080, "The port to host on")
func main() {
server := server.NewServer(*port)
fmt.Println("Initialising...")
server.Initialise()
// Set up the close handler
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
go func() {
<-c
fmt.Println("SIGTERM recieved, exiting...")
os.Exit(0)
}()
fmt.Println("Initialised")
server.Run()
}