mirror of
https://github.com/langgenius/dify-plugin-daemon.git
synced 2026-07-23 02:05:27 -04:00
30 lines
635 B
Go
30 lines
635 B
Go
package main
|
|
|
|
import (
|
|
"github.com/joho/godotenv"
|
|
"github.com/kelseyhightower/envconfig"
|
|
"github.com/langgenius/dify-plugin-daemon/internal/server"
|
|
"github.com/langgenius/dify-plugin-daemon/internal/types/app"
|
|
"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
|
|
)
|
|
|
|
func main() {
|
|
var config app.Config
|
|
|
|
// load env
|
|
godotenv.Load()
|
|
|
|
err := envconfig.Process("", &config)
|
|
if err != nil {
|
|
log.Panic("Error processing environment variables: %s", err.Error())
|
|
}
|
|
|
|
config.SetDefault()
|
|
|
|
if err := config.Validate(); err != nil {
|
|
log.Panic("Invalid configuration: %s", err.Error())
|
|
}
|
|
|
|
(&server.App{}).Run(&config)
|
|
}
|