sanbo
commited on
Commit
•
73795e0
1
Parent(s):
5e88779
update sth. at 2024-11-14 22:11:45
Browse files- Dockerfile +0 -1
- main.go +2 -3
Dockerfile
CHANGED
@@ -26,7 +26,6 @@ WORKDIR /root/
|
|
26 |
COPY --from=builder /app/ddg-chat-go .
|
27 |
|
28 |
# 设置环境变量
|
29 |
-
ENV API_PREFIX="/api"
|
30 |
ENV MAX_RETRY_COUNT="3"
|
31 |
ENV RETRY_DELAY="5000"
|
32 |
ENV PORT="7860"
|
|
|
26 |
COPY --from=builder /app/ddg-chat-go .
|
27 |
|
28 |
# 设置环境变量
|
|
|
29 |
ENV MAX_RETRY_COUNT="3"
|
30 |
ENV RETRY_DELAY="5000"
|
31 |
ENV PORT="7860"
|
main.go
CHANGED
@@ -29,7 +29,6 @@ var config Config
|
|
29 |
func init() {
|
30 |
godotenv.Load()
|
31 |
config = Config{
|
32 |
-
APIPrefix: getEnv("API_PREFIX", "/"),
|
33 |
APIKey: getEnv("API_KEY", ""),
|
34 |
MaxRetryCount: getIntEnv("MAX_RETRY_COUNT", 3),
|
35 |
RetryDelay: getDurationEnv("RETRY_DELAY", 5000),
|
@@ -94,8 +93,8 @@ func main() {
|
|
94 |
authorized := r.Group("/")
|
95 |
authorized.Use(authMiddleware())
|
96 |
{
|
97 |
-
authorized.GET(
|
98 |
-
authorized.POST(
|
99 |
}
|
100 |
|
101 |
port := os.Getenv("PORT")
|
|
|
29 |
func init() {
|
30 |
godotenv.Load()
|
31 |
config = Config{
|
|
|
32 |
APIKey: getEnv("API_KEY", ""),
|
33 |
MaxRetryCount: getIntEnv("MAX_RETRY_COUNT", 3),
|
34 |
RetryDelay: getDurationEnv("RETRY_DELAY", 5000),
|
|
|
93 |
authorized := r.Group("/")
|
94 |
authorized.Use(authMiddleware())
|
95 |
{
|
96 |
+
authorized.GET("/models", handleModels)
|
97 |
+
authorized.POST("/completions", handleCompletion)
|
98 |
}
|
99 |
|
100 |
port := os.Getenv("PORT")
|