Upgraded to the latest go-web-kit.
This commit is contained in:
parent
051474bdc9
commit
41f31a621f
14 changed files with 124 additions and 142 deletions
|
|
@ -11,11 +11,9 @@ import (
|
|||
|
||||
"MY/webapp/data"
|
||||
. "MY/webapp/common"
|
||||
"MY/webapp/auth"
|
||||
)
|
||||
|
||||
var STORE *session.Store
|
||||
|
||||
|
||||
func GetApiStream(c *fiber.Ctx) error {
|
||||
sql, args, err := sq.Select("*").From("stream").ToSql()
|
||||
err = data.SelectJson[data.Stream](c, err, sql, args...)
|
||||
|
|
@ -45,7 +43,7 @@ func PostApiLink(c *fiber.Ctx) error {
|
|||
var sql string
|
||||
var args []interface{}
|
||||
|
||||
_, err := CheckAuthed(c, false)
|
||||
_, err := auth.Check(c, false)
|
||||
if err != nil { return c.Redirect("/login/") }
|
||||
|
||||
link, err := ReceivePost[data.Link](c)
|
||||
|
|
@ -95,12 +93,6 @@ func Setup(app *fiber.App) {
|
|||
app.Get("/api/stream/:id", GetApiStreamId)
|
||||
app.Get("/api/stream/:id/links", GetApiStreamIdLinks)
|
||||
app.Post("/api/link", PostApiLink)
|
||||
|
||||
// api/auth.go
|
||||
app.Get("/api/authcheck", GetApiAuthCheck)
|
||||
app.Get("/api/logout", GetApiLogout)
|
||||
app.Post("/api/register", PostApiRegister)
|
||||
app.Post("/api/login", PostApiLogin)
|
||||
}
|
||||
|
||||
func Shutdown() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue