Add import/export

This commit is contained in:
Ettore Di Giacinto
2024-04-14 00:05:19 +02:00
parent 54de6221d1
commit 7c0f615952
5 changed files with 158 additions and 5 deletions

View File

@@ -91,6 +91,14 @@ func RegisterRoutes(webapp *fiber.App, pool *AgentPool, db *InMemoryDatabase, ap
})
})
webapp.Get("/settings/:name", func(c *fiber.Ctx) error {
return c.Render("views/settings", fiber.Map{
// "Character": agent.Character,
"Name": c.Params("name"),
})
})
webapp.Post("/settings/import", app.ImportAgent(pool))
webapp.Get("/settings/export/:name", app.ExportAgent(pool))
}
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")