csv/main.go

27 lines
512 B
Go
Raw Normal View History

2021-09-28 15:32:37 +00:00
package main
import (
"flag"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"myschools.me/wyh/gindownloadfile.git/handler"
)
func main() {
cf := flag.String("config", "config.yaml", "file of config")
flag.Parse()
viper.SetConfigFile(*cf)
if err := viper.ReadInConfig(); err != nil {
log.WithFields(log.Fields{
"func": "main",
}).Warnf("%s", err)
}
r := gin.Default()
r.GET(`/downloadfile`, handler.DownLoadFile)
r.Run(viper.GetString("app.host"))
}