MCPcopy
hub / github.com/pocketbase/pocketbase / bindBackupApi

Function bindBackupApi

apis/backup.go:17–25  ·  view source on GitHub ↗

bindBackupApi registers the file api endpoints and the corresponding handlers.

(app core.App, rg *router.RouterGroup[*core.RequestEvent])

Source from the content-addressed store, hash-verified

15
16// bindBackupApi registers the file api endpoints and the corresponding handlers.
17func bindBackupApi(app core.App, rg *router.RouterGroup[*core.RequestEvent]) {
18 sub := rg.Group("/backups")
19 sub.GET("", backupsList).Bind(RequireSuperuserAuth())
20 sub.POST("", backupCreate).Bind(RequireSuperuserAuth())
21 sub.POST("/upload", backupUpload).Bind(BodyLimit(0), RequireSuperuserAuth())
22 sub.GET("/{key}", backupDownload) // relies on superuser file token
23 sub.DELETE("/{key}", backupDelete).Bind(RequireSuperuserAuth())
24 sub.POST("/{key}/restore", backupRestore).Bind(RequireSuperuserAuth())
25}
26
27type backupFileInfo struct {
28 Modified types.DateTime `json:"modified"`

Callers 1

NewRouterFunction · 0.85

Calls 7

RequireSuperuserAuthFunction · 0.85
BodyLimitFunction · 0.85
GroupMethod · 0.80
GETMethod · 0.80
POSTMethod · 0.80
DELETEMethod · 0.80
BindMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…