-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.go
More file actions
32 lines (28 loc) · 635 Bytes
/
Copy pathmain.go
File metadata and controls
32 lines (28 loc) · 635 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"github.com/vicanso/elton"
"github.com/vicanso/elton/middleware"
"github.com/vicanso/proxy-pool/config"
_ "github.com/vicanso/proxy-pool/controller"
"github.com/vicanso/proxy-pool/log"
"github.com/vicanso/proxy-pool/router"
"go.uber.org/zap"
)
func main() {
logger := log.Default()
e := elton.New()
e.Use(func(c *elton.Context) error {
c.NoCache()
return c.Next()
})
e.Use(middleware.NewDefaultResponder())
router.Init(e)
addr := config.GetListenAddr()
logger.Info("start to linstening...",
zap.String("listen", addr),
)
err := e.ListenAndServe(addr)
if err != nil {
panic(err)
}
}