Start api revamp

This commit is contained in:
Daniel 2018-09-21 16:38:18 +02:00
parent 6bee0bf2d7
commit b246453a83
16 changed files with 452 additions and 45 deletions

31
api/old/routes.go Normal file
View 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),
},
}