31 lines
520 B
Go
31 lines
520 B
Go
// main.go
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
if len(os.Args) > 1 {
|
|
switch os.Args[1] {
|
|
case "service":
|
|
InstallService()
|
|
return
|
|
case "test":
|
|
fmt.Println("Starting in TEST MODE (Caching Disabled, Cache Cleared)")
|
|
TestMode = true
|
|
// Wipe the cache so we don't see old files
|
|
ClearCache()
|
|
StartServer()
|
|
return
|
|
default:
|
|
fmt.Printf("Unknown command: %s\nUsage: blog [service|test]\n", os.Args[1])
|
|
return
|
|
}
|
|
}
|
|
|
|
// Default behavior: Production Server
|
|
StartServer()
|
|
}
|