tailscale/cmd/hello/hello.go
Brad Fitzpatrick 92179b1fc7 cmd/hello: split server into helloserver package
Move the template, request handler, and HTTP/HTTPS server wiring out
of package main and into a new cmd/hello/helloserver package so the
server can be embedded in other binaries. The main package now only
constructs a helloserver.Server with the production addresses and
calls Run.

While here, drop the -http, -https, and -test-ip flags along with the
dev-mode template and fake-data fallbacks they enabled; the binary is
only run in production.

Updates tailscale/corp#32398

Change-Id: Id1d38b981733334cafc596021130f36e1c1eed67
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-04-30 08:40:55 -07:00

21 lines
381 B
Go

// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// The hello binary runs hello.ts.net.
package main // import "tailscale.com/cmd/hello"
import (
"log"
"tailscale.com/cmd/hello/helloserver"
)
func main() {
s := &helloserver.Server{
HTTPAddr: ":80",
HTTPSAddr: ":443",
}
log.Printf("Starting hello server.")
log.Fatal(s.Run())
}