28 lines
613 B
Go
28 lines
613 B
Go
![]() |
package main
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
type Route struct {
|
||
|
Name string
|
||
|
Method string
|
||
|
Pattern string
|
||
|
HandlerFunc http.HandlerFunc
|
||
|
}
|
||
|
|
||
|
type Routes []Route
|
||
|
|
||
|
var routes = Routes{
|
||
|
Route{"addTerm", "POST", "/term", newTerm},
|
||
|
Route{"getTerms", "GET", "/term", getTerms},
|
||
|
Route{"getTerm","GET","/term/{year}/{month}", getTerm},
|
||
|
Route{"test", "GET", "/test", proba},
|
||
|
|
||
|
Route{"newQuery", "POST", "/query", newQuery},
|
||
|
Route{"bookTerm", "POST", "/book", newBooking},
|
||
|
Route{"bookTerm", "DELETE", "/book", delBooking},
|
||
|
|
||
|
Route{"postTest", "POST", "/test", postTest},
|
||
|
Route{"postTest", "DELETE", "/test", deleteTest},
|
||
|
}
|