28 lines
565 B
Go
Raw Normal View History

2024-12-14 12:40:29 +08:00
package api
import (
2025-01-25 22:08:36 +08:00
"git.solsynth.dev/hypernet/nexus/pkg/nex/sec"
2024-12-14 12:40:29 +08:00
"github.com/gofiber/fiber/v2"
)
func MapAPIs(app *fiber.App, baseURL string) {
api := app.Group(baseURL).Name("API")
{
2025-01-25 22:15:35 +08:00
api.Get("/well-known/sources", getNewsSources)
2025-01-25 22:08:36 +08:00
admin := api.Group("/admin").Name("Admin")
{
admin.Post("/scan", sec.ValidatorMiddleware, adminTriggerScanTask)
}
2024-12-14 12:40:29 +08:00
api.Get("/link/*", getLinkMeta)
2025-01-25 22:15:35 +08:00
news := api.Group("/news").Name("News")
{
2025-01-26 13:20:50 +08:00
news.Get("/today", getTodayNews)
2025-01-25 22:15:35 +08:00
news.Get("/", listNewsArticles)
news.Get("/:hash", getNewsArticle)
}
2024-12-14 12:40:29 +08:00
}
}