init hello world

This commit is contained in:
2025-07-20 20:43:44 -04:00
parent 314fb8faa1
commit 349f7fad57
5 changed files with 98 additions and 2 deletions

31
main.go
View File

@@ -1,7 +1,34 @@
package main
import "fmt"
import (
"context"
"fmt"
"io"
"os"
"os/signal"
"git.dubyatp.xyz/orphanage/http"
)
func run(ctx context.Context, w io.Writer, args []string) error {
ctx, cancel := signal.NotifyContext(ctx, os.Interrupt)
defer cancel()
config := struct {
Host string
Port string
}{
Host: "0.0.0.0",
Port: "8080",
}
return http.StartServer(ctx, config)
}
func main() {
fmt.Println("Hello, World!")
ctx := context.Background()
if err := run(ctx, os.Stdout, os.Args); err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err)
os.Exit(1)
}
}