Skip to content

Commit

Permalink
feat: write connect info to file (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH committed Jan 30, 2024
1 parent bf8c104 commit 6ba2c7e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.go
Expand Up @@ -11,13 +11,15 @@ import (
"net"
"net/http"
"os"
"path/filepath"
"time"

"github.com/IceWhaleTech/CasaOS-AppManagement/common"
"github.com/IceWhaleTech/CasaOS-AppManagement/pkg/config"
"github.com/IceWhaleTech/CasaOS-AppManagement/route"
"github.com/IceWhaleTech/CasaOS-AppManagement/service"
"github.com/IceWhaleTech/CasaOS-Common/model"
"github.com/IceWhaleTech/CasaOS-Common/utils/file"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
"github.com/coreos/go-systemd/daemon"
"github.com/robfig/cron/v3"
Expand Down Expand Up @@ -113,6 +115,14 @@ func main() {
panic(err)
}

urlFilePath := filepath.Join(config.CommonInfo.RuntimePath, "app-management.url")
if err := file.CreateFileAndWriteContent(urlFilePath, "http://"+listener.Addr().String()); err != nil {
logger.Error("error when creating address file", zap.Error(err),
zap.Any("address", listener.Addr().String()),
zap.Any("filepath", urlFilePath),
)
}

// initialize routers and register at gateway
{
apiPaths := []string{
Expand Down

0 comments on commit 6ba2c7e

Please sign in to comment.