newsbot-portal/cmd/server.go

24 lines
549 B
Go
Raw Normal View History

2024-05-11 09:56:19 -07:00
package main
import (
"context"
"fmt"
2024-05-12 09:21:20 -07:00
"git.jamestombleson.com/jtom38/newsbot-portal/apiclient"
2024-05-11 09:56:19 -07:00
"git.jamestombleson.com/jtom38/newsbot-portal/internal/config"
"git.jamestombleson.com/jtom38/newsbot-portal/internal/handlers"
)
func main() {
ctx := context.Background()
cfg := config.New()
2024-07-07 07:57:23 -07:00
apiClient := apiclient.New(cfg.ApiServerAddress)
2024-05-12 09:21:20 -07:00
server := handlers.NewServer(ctx, cfg, apiClient)
2024-05-11 09:56:19 -07:00
fmt.Println("The server is online and waiting for requests.")
fmt.Printf("http://%v:8082\r\n", cfg.ServerAddress)
server.Router.Start(":8082")
}