🚚 Move api path

This commit is contained in:
LittleSheep 2024-07-16 17:02:16 +08:00
parent 33d6766f95
commit 83df95435c
2 changed files with 5 additions and 4 deletions

View File

@ -2,10 +2,10 @@ package api
import "github.com/gofiber/fiber/v2" import "github.com/gofiber/fiber/v2"
func MapAPIs(app *fiber.App) { func MapAPIs(app *fiber.App, baseURL string) {
app.Get("/.well-known/destinations", getDestinations) app.Get("/.well-known/destinations", getDestinations)
api := app.Group("/api").Name("API") api := app.Group(baseURL).Name("API")
{ {
api.Get("/attachments/:id/meta", getAttachmentMeta) api.Get("/attachments/:id/meta", getAttachmentMeta)
api.Get("/attachments/:id", openAttachment) api.Get("/attachments/:id", openAttachment)

View File

@ -1,10 +1,11 @@
package server package server
import ( import (
"strings"
"git.solsynth.dev/hydrogen/paperclip/pkg/internal/gap" "git.solsynth.dev/hydrogen/paperclip/pkg/internal/gap"
"git.solsynth.dev/hydrogen/paperclip/pkg/internal/server/api" "git.solsynth.dev/hydrogen/paperclip/pkg/internal/server/api"
"git.solsynth.dev/hydrogen/paperclip/pkg/internal/server/exts" "git.solsynth.dev/hydrogen/paperclip/pkg/internal/server/exts"
"strings"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors" "github.com/gofiber/fiber/v2/middleware/cors"
@ -55,7 +56,7 @@ func NewServer() {
A.Use(gap.H.AuthMiddleware) A.Use(gap.H.AuthMiddleware)
A.Use(exts.LinkAccountMiddleware) A.Use(exts.LinkAccountMiddleware)
api.MapAPIs(A) api.MapAPIs(A, "/")
} }
func Listen() { func Listen() {