diff --git a/server/.env.example b/server/.env.example new file mode 100644 index 0000000..b0e131e --- /dev/null +++ b/server/.env.example @@ -0,0 +1,13 @@ +PORT=8080 +# Marketing MySQL +MARKETING_DB_HOST=127.0.0.1 +MARKETING_DB_PORT=3306 +MARKETING_DB_USER=root +MARKETING_DB_PASSWORD= +MARKETING_DB_NAME=market +# YMT MySQL +YMT_DB_HOST=127.0.0.1 +YMT_DB_PORT=3306 +YMT_DB_USER=root +YMT_DB_PASSWORD= +YMT_DB_NAME=market diff --git a/server/.env.local b/server/.env.local new file mode 100644 index 0000000..122fdd4 --- /dev/null +++ b/server/.env.local @@ -0,0 +1,15 @@ +PORT=8077 +MARKETING_DB_HOST=192.168.6.92 +MARKETING_DB_PORT=3306 +MARKETING_DB_USER=root +MARKETING_DB_PASSWORD=lansexiongdi +MARKETING_DB_NAME=market +YMT_DB_HOST=47.97.27.195 +YMT_DB_PORT=3306 +YMT_DB_USER=root +YMT_DB_PASSWORD=lansexiongdi6, +YMT_DB_NAME=merketing +MARKETING_REDIS_HOST=192.168.6.75 +MARKETING_REDIS_PORT=6379 +MARKETING_REDIS_PASSWORD=lansexiongdi +MARKETING_REDIS_DB=0 diff --git a/server/cmd/server/main.go b/server/cmd/server/main.go index ebb5bc7..58eb4ea 100644 --- a/server/cmd/server/main.go +++ b/server/cmd/server/main.go @@ -41,7 +41,7 @@ func main() { log.Println("skip migrations: YMT DSN missing") } r := api.NewRouter(ymt, marketing) - addr := ":" + func() string { s := os.Getenv("PORT"); if s == "" { return "8080" }; return s }() + addr := ":" + func() string { s := os.Getenv("PORT"); if s == "" { return "8077" }; return s }() srv := &http.Server{Addr: addr, Handler: r, ReadTimeout: 15 * time.Second, WriteTimeout: 60 * time.Second} log.Println("server listening on ", addr) log.Fatal(srv.ListenAndServe()) diff --git a/server/server b/server/server deleted file mode 100755 index e1c1391..0000000 Binary files a/server/server and /dev/null differ diff --git a/web/index.html b/web/index.html index af8a969..44cb24d 100644 --- a/web/index.html +++ b/web/index.html @@ -4,8 +4,8 @@