generated from VLADIMIR/template
up
This commit is contained in:
parent
7b7bd3e4bb
commit
cd87774380
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,4 +25,3 @@ go.work
|
||||
go.sum
|
||||
|
||||
data/
|
||||
bin/
|
||||
|
||||
BIN
bin/pinned_message_macos_arm64
Executable file
BIN
bin/pinned_message_macos_arm64
Executable file
Binary file not shown.
@ -21,12 +21,18 @@ import (
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
)
|
||||
|
||||
const (
|
||||
tcpPort = ":8200"
|
||||
gwPort = ":8210"
|
||||
clientPort = ":8220"
|
||||
)
|
||||
|
||||
//go:embed static/user/*
|
||||
var userFS embed.FS
|
||||
|
||||
func main() {
|
||||
// Create a listener on TCP port
|
||||
lis, err := net.Listen("tcp", ":8080")
|
||||
lis, err := net.Listen("tcp", tcpPort)
|
||||
if err != nil {
|
||||
log.Fatalln("Failed to listen:", err)
|
||||
}
|
||||
@ -55,7 +61,7 @@ func main() {
|
||||
),
|
||||
)
|
||||
// Serve gRPC server
|
||||
log.Println("Serving gRPC on 0.0.0.0:8080")
|
||||
log.Println("Serving gRPC on 0.0.0.0" + tcpPort)
|
||||
go func() {
|
||||
log.Fatalln(s.Serve(lis))
|
||||
}()
|
||||
@ -63,7 +69,7 @@ func main() {
|
||||
// Create a client connection to the gRPC server we just started
|
||||
// This is where the gRPC-Gateway proxies the requests
|
||||
conn, err := grpc.NewClient(
|
||||
"0.0.0.0:8080",
|
||||
"0.0.0.0"+tcpPort,
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
)
|
||||
if err != nil {
|
||||
@ -78,12 +84,12 @@ func main() {
|
||||
}
|
||||
|
||||
gwServer := &http.Server{
|
||||
Addr: ":8090",
|
||||
Addr: gwPort,
|
||||
Handler: cors(gwmux),
|
||||
}
|
||||
|
||||
// Serve gRPC-Gateway server
|
||||
log.Println("Serving gRPC-Gateway on http://0.0.0.0:8090")
|
||||
log.Println("Serving gRPC-Gateway on http://0.0.0.0" + gwPort)
|
||||
go func() {
|
||||
log.Fatalln(gwServer.ListenAndServe())
|
||||
}()
|
||||
@ -97,8 +103,8 @@ func main() {
|
||||
muxUser.Handle("/", fileServerUser)
|
||||
|
||||
// Serve admin web server
|
||||
log.Println("Serving user web on http://0.0.0.0:8100")
|
||||
log.Fatalln(http.ListenAndServe(":8100", muxUser))
|
||||
log.Println("Serving user web on http://0.0.0.0" + clientPort)
|
||||
log.Fatalln(http.ListenAndServe(clientPort, muxUser))
|
||||
}
|
||||
|
||||
func cors(h http.Handler) http.Handler {
|
||||
|
||||
@ -1 +1 @@
|
||||
import{_ as o,c as s,a as t,o as a}from"./index-4kR8eUDl.js";const n={},c={class:"about"};function r(_,e){return a(),s("div",c,e[0]||(e[0]=[t("h1",null,"This is an about page",-1)]))}const l=o(n,[["render",r]]);export{l as default};
|
||||
import{_ as o,c as s,a as t,o as a}from"./index-BGbuJmjp.js";const n={},c={class:"about"};function r(_,e){return a(),s("div",c,e[0]||(e[0]=[t("h1",null,"This is an about page",-1)]))}const l=o(n,[["render",r]]);export{l as default};
|
||||
File diff suppressed because one or more lines are too long
@ -5,7 +5,7 @@
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Vite App</title>
|
||||
<script type="module" crossorigin src="/assets/index-4kR8eUDl.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-BGbuJmjp.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-8MK_B0RW.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user