archat-server/main.go

29 lines
464 B
Go
Raw Normal View History

2024-03-21 21:36:25 +00:00
package main
import (
"log"
"os"
2024-04-29 00:02:51 +00:00
"krzyzanowski.dev/archat/client"
"krzyzanowski.dev/archat/server"
2024-03-21 21:36:25 +00:00
)
func main() {
args := os.Args[1:]
if len(args) != 1 {
log.Fatalln("You must provide only one argument which is type of " +
"application: 'server' or 'client'")
}
runType := args[0]
if runType == "client" {
client.RunClient()
2024-03-21 21:36:25 +00:00
} else if runType == "server" {
server.RunServer()
2024-03-21 21:36:25 +00:00
} else {
log.Fatalf("Unknown run type %s\n", runType)
}
}