forked from mtusi2026/mtusi2026lab2
20 lines
343 B
Go
20 lines
343 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"go.uber.org/fx"
|
|
)
|
|
|
|
// run dispatches the server command or the container healthcheck.
|
|
func run(args []string) error {
|
|
if len(args) == 0 {
|
|
fx.New(CreateApp()).Run()
|
|
return nil
|
|
}
|
|
if len(args) == 1 && args[0] == "healthcheck" {
|
|
return healthcheck()
|
|
}
|
|
return fmt.Errorf("usage: server [healthcheck]")
|
|
}
|