🚧 Work on actor object
This commit is contained in:
parent
673b42394c
commit
60131a4701
4 changed files with 152 additions and 32 deletions
11
app/app.go
11
app/app.go
|
|
@ -2,9 +2,13 @@ package app
|
|||
|
||||
import (
|
||||
"codeberg.org/danjones000/lenore/config"
|
||||
vocab "github.com/go-ap/activitypub"
|
||||
"github.com/go-ap/processing"
|
||||
"github.com/gofiber/adaptor/v2"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||
"github.com/gofiber/fiber/v2/middleware/logger"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func New() *fiber.App {
|
||||
|
|
@ -26,6 +30,13 @@ func New() *fiber.App {
|
|||
return c.JSON(&conf)
|
||||
})
|
||||
|
||||
var meHandle processing.ItemHandlerFn
|
||||
meHandle = func(r *http.Request) (vocab.Item, error) {
|
||||
return conf.GetActor(), nil
|
||||
}
|
||||
|
||||
app.Get("/me", adaptor.HTTPHandler(meHandle))
|
||||
|
||||
app.Post("/check_pass", func(c *fiber.Ctx) error {
|
||||
req := new(struct {
|
||||
Pass string `json:"pass"`
|
||||
|
|
|
|||
Reference in a new issue