Merge branch 'master' of https://github.com/acheong08/ChatGPT-to-API
This commit is contained in:
commit
959af67acb
6
main.go
6
main.go
@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"freechatgpt/internal/tokens"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/fvbock/endless"
|
||||
"github.com/gin-gonic/gin"
|
||||
@ -24,6 +25,11 @@ func init() {
|
||||
if PORT == "" {
|
||||
PORT = "8080"
|
||||
}
|
||||
accessToken := os.Getenv("ACCESS_TOKENS")
|
||||
if accessToken != "" {
|
||||
accessTokens := strings.Split(accessToken, ",")
|
||||
ACCESS_TOKENS = tokens.NewAccessToken(accessTokens)
|
||||
}
|
||||
// Check if access_tokens.json exists
|
||||
if _, err := os.Stat("access_tokens.json"); os.IsNotExist(err) {
|
||||
// Create the file
|
||||
|
Reference in New Issue
Block a user