mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-05 20:26:47 +02:00
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>
21 lines
381 B
Go
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())
|
|
}
|