mirror of
https://github.com/safing/portbase
synced 2025-09-10 23:34:42 +00:00
Start api revamp
This commit is contained in:
parent
6bee0bf2d7
commit
b246453a83
16 changed files with 452 additions and 45 deletions
31
api/old/routes.go
Normal file
31
api/old/routes.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
// Copyright Safing ICS Technologies GmbH. Use of this source code is governed by the AGPL license that can be found in the LICENSE file.
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Route struct {
|
||||
Name string
|
||||
Method string
|
||||
Path string
|
||||
Handler http.Handler
|
||||
}
|
||||
|
||||
type Routes []Route
|
||||
|
||||
var routes = Routes{
|
||||
Route{
|
||||
"Index",
|
||||
"GET",
|
||||
"/test",
|
||||
http.StripPrefix("/test", http.FileServer(http.Dir("api/test"))),
|
||||
},
|
||||
Route{
|
||||
"Websockets",
|
||||
"GET",
|
||||
"/api/v1",
|
||||
http.HandlerFunc(apiVersionOneHandler),
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue