2024-05-04 00:11:56 +07:00
|
|
|
package handler
|
|
|
|
|
2024-10-29 21:30:04 +07:00
|
|
|
func (s *fiberServer) Routes() {
|
|
|
|
s.App.Get("/", s.homeHandler)
|
2024-10-30 14:23:45 +07:00
|
|
|
s.App.Get("/remote-nodes", s.remoteNodesHandler)
|
2024-11-04 16:36:22 +07:00
|
|
|
s.App.Get("/remote-nodes/id/:id", s.nodeHandler)
|
2024-10-30 14:23:45 +07:00
|
|
|
s.App.Get("/add-node", s.addNodeHandler)
|
2024-11-04 23:53:09 +07:00
|
|
|
s.App.Put("/add-node", s.addNodeHandler)
|
2024-05-04 00:11:56 +07:00
|
|
|
|
2024-10-29 21:30:04 +07:00
|
|
|
// V1 API routes
|
|
|
|
v1 := s.App.Group("/api/v1")
|
2024-05-04 00:11:56 +07:00
|
|
|
|
2024-06-03 14:17:51 +07:00
|
|
|
// these routes are public, they don't require a prober api key
|
|
|
|
v1.Get("/nodes", Nodes)
|
2024-11-04 23:53:09 +07:00
|
|
|
v1.Post("/nodes", AddNode) // old add node form action endpoint. Deprecated: Use PUT /add-node instead
|
2024-06-03 14:17:51 +07:00
|
|
|
v1.Get("/nodes/id/:id", Node)
|
2024-05-06 17:19:17 +07:00
|
|
|
v1.Get("/nodes/logs", ProbeLogs)
|
2024-05-31 13:30:56 +07:00
|
|
|
v1.Get("/fees", NetFees)
|
2024-05-06 13:35:15 +07:00
|
|
|
v1.Get("/countries", Countries)
|
2024-06-03 14:17:51 +07:00
|
|
|
|
|
|
|
// these routes are for prober, they require a prober api key
|
2024-05-04 19:52:22 +07:00
|
|
|
v1.Get("/job", CheckProber, GiveJob)
|
2024-05-05 01:42:47 +07:00
|
|
|
v1.Post("/job", CheckProber, ProcessJob)
|
2024-05-04 00:11:56 +07:00
|
|
|
}
|