add static

This commit is contained in:
2025-05-15 01:39:25 +07:00
parent a0f50ea2bf
commit 1332a6acb5
13 changed files with 601 additions and 8 deletions
+17 -5
View File
@@ -1,15 +1,16 @@
package main
import (
"context"
"evening_detective/internal/app"
proto "evening_detective/proto"
"context"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"log"
"net"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
func main() {
@@ -51,6 +52,17 @@ func main() {
Handler: gwmux,
}
// Serve gRPC-Gateway server
log.Println("Serving gRPC-Gateway on http://0.0.0.0:8090")
log.Fatalln(gwServer.ListenAndServe())
go func() {
log.Fatalln(gwServer.ListenAndServe())
}()
mux := http.NewServeMux()
fileServer := http.FileServer(http.Dir("./static/"))
mux.Handle("/", fileServer)
// Serve web server
log.Println("Serving web on http://0.0.0.0:8100")
log.Fatalln(http.ListenAndServe(":8100", mux))
}