package main

import (
	"log"
	"os"
	"os/signal"
	"syscall"

	"dubbo.apache.org/dubbo-go/v3/common/constant"
	"dubbo.apache.org/dubbo-go/v3/config"
	_ "dubbo.apache.org/dubbo-go/v3/imports"
	"github.com/filebrowser/filebrowser/v2/service"
)

func main() {
	os.Setenv(constant.ConfigFileEnvKey, "../conf/dubbogo.yaml")
	config.SetProviderService(&service.FilesProvider{})
	if err := config.Load(); err != nil {
		panic(err)
	}
	sigc := make(chan os.Signal, 1)
	signal.Notify(sigc, os.Interrupt, syscall.SIGTERM)
	sig := <-sigc
	log.Printf("Caught signal %s: shutting down.", sig)
	os.Exit(0)
}
