generated from VLADIMIR/template
add static
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user