mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
creating...
This commit is contained in:
32
src/server/web/api/route.go
Normal file
32
src/server/web/api/route.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"server/torr"
|
||||
"server/version"
|
||||
)
|
||||
|
||||
type requestI struct {
|
||||
Action string `json:"action,omitempty"`
|
||||
}
|
||||
|
||||
type responseI struct {
|
||||
}
|
||||
|
||||
var bts *torr.BTServer
|
||||
|
||||
func SetupRouteApi(route *gin.Engine, serv *torr.BTServer) {
|
||||
bts = serv
|
||||
route.GET("/echo", echo)
|
||||
|
||||
route.POST("/settings", settings)
|
||||
|
||||
route.POST("/torrents", torrents)
|
||||
|
||||
route.GET("/stream", stream)
|
||||
route.GET("/stream/*fname", stream)
|
||||
}
|
||||
|
||||
func echo(c *gin.Context) {
|
||||
c.String(200, "{\"version\": \"%v\"}", version.Version)
|
||||
}
|
||||
Reference in New Issue
Block a user