You've already forked nyx
							
							
				mirror of
				https://github.com/rls-moe/nyx
				synced 2025-10-31 12:04:15 +00:00 
			
		
		
		
	Last minute touch-ups
This commit is contained in:
		| @@ -35,6 +35,7 @@ func LoadTemplates() error { | ||||
| 	if err != nil { | ||||
| 		panic(err) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Router sets up the Administration Panel | ||||
|   | ||||
| @@ -69,6 +69,7 @@ func LoadTemplates() error { | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func Router(r chi.Router) { | ||||
|   | ||||
| @@ -77,5 +77,5 @@ func Start(config *config.Config) error { | ||||
| 		Addr:           config.ListenOn, | ||||
| 		MaxHeaderBytes: 1 * 1024 * 1024, | ||||
| 	} | ||||
| 	srv.ListenAndServe() | ||||
| 	return srv.ListenAndServe() | ||||
| } | ||||
|   | ||||
							
								
								
									
										18
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								main.go
									
									
									
									
									
								
							| @@ -1,18 +1,28 @@ | ||||
| package main | ||||
|  | ||||
| import ( | ||||
| 	"fmt" | ||||
| 	"go.rls.moe/nyx/config" | ||||
| 	"go.rls.moe/nyx/http" | ||||
| 	"log" | ||||
| 	"os" | ||||
| 	"time" | ||||
| ) | ||||
|  | ||||
| func main() { | ||||
| 	c, err := config.Load() | ||||
| 	if err != nil { | ||||
| 		fmt.Printf("Could not read configuration: %s\n", err) | ||||
| 		log.Printf("Could not read configuration: %s\n", err) | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	fmt.Println("Starting Server") | ||||
| 	http.Start(c) | ||||
| 	log.Println("Starting Server") | ||||
| 	if err := http.Start(c); err != nil { | ||||
| 		log.Printf("Could not start server or server crashed: %s\n", err) | ||||
| 		log.Printf("Waiting 10 seconds before dying...") | ||||
| 		time.Sleep(10 * time.Second) | ||||
| 		log.Printf("Exiting") | ||||
| 		os.Exit(1) | ||||
| 		return | ||||
| 	} | ||||
| 	os.Exit(0) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user