INIT
This commit is contained in:
parent
d9a1837f3b
commit
ebd2f05ae2
69 changed files with 2335 additions and 451 deletions
32
backend.old/api.go
Normal file
32
backend.old/api.go
Normal file
|
@ -0,0 +1,32 @@
|
|||
package main
|
||||
|
||||
func (w *Webapp) initApi() {
|
||||
|
||||
stream := NewServer()
|
||||
|
||||
w.Stream = stream
|
||||
|
||||
http_api := w.Engine.Group("/api")
|
||||
http_api.GET("/priority", w.GetPriority)
|
||||
http_api.POST("/priority", w.SetPriority)
|
||||
|
||||
// SSE
|
||||
http_api.GET("/sse", HeadersMiddleware(), stream.serveHTTP(), stream.retvalSSE())
|
||||
|
||||
http_api.POST("/startheat", w.StartHeatTimer)
|
||||
http_api.GET("/stopheat", w.StopHeatTimer)
|
||||
http_api.POST("/saveheat", w.SaveHeat)
|
||||
http_api.POST("/deleteheat", w.DeleteHeat)
|
||||
http_api.GET("/loadheats", w.LoadHeats)
|
||||
http_api.GET("/runningheat", w.LoadRunning)
|
||||
|
||||
// // Surfers
|
||||
// http_api.GET("/surfers", w.GetSurfers)
|
||||
// http_api.POST("/updatesurfer", w.UpdateSurfer)
|
||||
// http_api.POST("/deletesurfer", w.DeleteSurfer)
|
||||
|
||||
// // Users
|
||||
// http_api.GET("/users", w.GetUsers)
|
||||
// http_api.POST("/updateuser", w.UpdateUser)
|
||||
// http_api.POST("/deleteuser", w.DeleteUser)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue