Added text export
This commit is contained in:
17
pages/export/JSON.go
Normal file
17
pages/export/JSON.go
Normal file
@ -0,0 +1,17 @@
|
||||
package export
|
||||
|
||||
import (
|
||||
"github.com/aerogo/aero"
|
||||
)
|
||||
|
||||
// JSON renders the anime list items in JSON format.
|
||||
func JSON(ctx aero.Context) error {
|
||||
animeList, err := getAnimeList(ctx)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ctx.Response().SetHeader("Content-Disposition", "attachment; filename=\"anime-list.json\"")
|
||||
return ctx.JSON(animeList)
|
||||
}
|
Reference in New Issue
Block a user