Skip to content

Commit

Permalink
feat(ui): Add OpenAI API client UI (aurora-develop#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x676e67 authored Apr 5, 2024
1 parent cc64b08 commit 50fb134
Show file tree
Hide file tree
Showing 4 changed files with 6,996 additions and 0 deletions.
14 changes: 14 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ package main
import (
"aurora/internal/chatgpt"
"bufio"
"embed"
"io/fs"
"log"
"log/slog"
"net/http"
"net/url"
"os"
"strings"
Expand Down Expand Up @@ -54,6 +58,9 @@ func checkProxy() *proxys.IProxy {
return &proxyIP
}

//go:embed web/*
var staticFiles embed.FS

func registerRouter() *gin.Engine {
handler := NewHandle(
checkProxy(),
Expand Down Expand Up @@ -82,6 +89,13 @@ func registerRouter() *gin.Engine {
authGroup := router.Group("").Use(Authorization)
authGroup.POST("/v1/chat/completions", handler.nightmare)
authGroup.GET("/v1/models", handler.engines)

subFS, err := fs.Sub(staticFiles, "web")
if err != nil {
log.Fatal(err)
}
router.StaticFS("/web", http.FS(subFS))

return router
}

Expand Down
Binary file added web/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 50fb134

Please sign in to comment.