1
0
mirror of https://github.com/lus/pasty.git synced 2023-08-10 21:13:09 +03:00
pasty/cmd/pasty/main.go
2020-08-24 18:08:27 +02:00

33 lines
680 B
Go

package main
import (
"github.com/Lukaesebrot/pasty/internal/env"
"github.com/Lukaesebrot/pasty/internal/storage"
"github.com/Lukaesebrot/pasty/internal/web"
"log"
)
func main() {
// Load the optional .env file
log.Println("Loading the optional .env file...")
env.Load()
// Load the configured storage driver
log.Println("Loading the configured storage driver...")
err := storage.Load()
if err != nil {
panic(err)
}
defer func() {
log.Println("Terminating the storage driver...")
err := storage.Current.Terminate()
if err != nil {
log.Fatalln(err)
}
}()
// Serve the web resources
log.Println("Serving the web resources...")
panic(web.Serve())
}