This repository has been archived on 2024-04-25. You can view files and clone it, but cannot push or open issues or pull requests.
golang-rest-example/cmd/server.go

23 lines
401 B
Go

package main
import (
"log"
"net/http"
"github.com/mentos1386/golang-rest-example/pkg/api"
"github.com/mentos1386/golang-rest-example/pkg/openapi"
)
func main() {
service := &api.ApiService{}
srv, err := openapi.NewServer(service)
if err != nil {
log.Fatal(err)
}
log.Println("Starting server on :1234")
if err := http.ListenAndServe(":1234", srv); err != nil {
log.Fatal(err)
}
}