Example #1
-1
File: server.go Project: xtfly/gofd
// OnStart ...
func (s *Server) OnStart(c *common.Config, e *echo.Echo) error {
	go func() { s.sessionMgnt.Start() }()

	e.Use(middleware.BasicAuth(s.Auth))
	e.POST("/api/v1/server/tasks", s.CreateTask)
	e.DELETE("/api/v1/server/tasks/:id", s.CancelTask)
	e.GET("/api/v1/server/tasks/:id", s.QueryTask)
	e.POST("/api/v1/server/tasks/status", s.ReportTask)

	return nil
}