2024-05-03 17:11:56 +00:00
|
|
|
package handler
|
|
|
|
|
2024-10-29 14:30:04 +00:00
|
|
|
func (s *fiberServer) Routes() {
|
|
|
|
s.App.Get("/", s.homeHandler)
|
2024-11-06 17:59:57 +00:00
|
|
|
s.App.Get("/robots.txt", s.robotsTxtHandler)
|
2024-10-30 07:23:45 +00:00
|
|
|
s.App.Get("/remote-nodes", s.remoteNodesHandler)
|
2024-11-04 09:36:22 +00:00
|
|
|
s.App.Get("/remote-nodes/id/:id", s.nodeHandler)
|
2024-10-30 07:23:45 +00:00
|
|
|
s.App.Get("/add-node", s.addNodeHandler)
|
2024-11-04 16:53:09 +00:00
|
|
|
s.App.Put("/add-node", s.addNodeHandler)
|
2024-05-03 17:11:56 +00:00
|
|
|
|
2024-11-06 14:34:05 +00:00
|
|
|
// This is temporary route to redirect old path to new one. Once search
|
|
|
|
// engine results updated to the new path, this route should be removed.
|
|
|
|
s.App.Get("/remote-nodes/logs", s.redirectLogs)
|
|
|
|
|
2024-10-29 14:30:04 +00:00
|
|
|
// V1 API routes
|
|
|
|
v1 := s.App.Group("/api/v1")
|
2024-05-03 17:11:56 +00:00
|
|
|
|
2024-06-03 07:17:51 +00:00
|
|
|
// these routes are public, they don't require a prober api key
|
2024-11-06 15:15:53 +00:00
|
|
|
v1.Get("/nodes", s.nodesAPI)
|
|
|
|
v1.Post("/nodes", s.addNodeAPI) // old add node form action endpoint. Deprecated: Use PUT /add-node instead
|
|
|
|
v1.Get("/nodes/id/:id", s.nodeAPI)
|
|
|
|
v1.Get("/nodes/logs", s.probeLogsAPI)
|
|
|
|
v1.Get("/fees", s.netFeesAPI)
|
|
|
|
v1.Get("/countries", s.countriesAPI)
|
2024-06-03 07:17:51 +00:00
|
|
|
|
|
|
|
// these routes are for prober, they require a prober api key
|
2024-11-06 15:15:53 +00:00
|
|
|
v1.Get("/job", s.checkProberMW, s.giveJobAPI)
|
|
|
|
v1.Post("/job", s.checkProberMW, s.processJobAPI)
|
2024-05-03 17:11:56 +00:00
|
|
|
}
|