-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhandlerAPI10.go
More file actions
49 lines (31 loc) · 1.29 KB
/
handlerAPI10.go
File metadata and controls
49 lines (31 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package main
import (
"fmt"
"net/http"
)
// ========== ========== ========== ========== ==========
func handlerAPI10(w http.ResponseWriter, r *http.Request) {
output := ""
output += "API Response"
// API can recieve HTTP verbs: GET or POST and is versioned for backwards compatability when large changes are made
// URL: /api/
// Behavior: Information about the versions of the API that are available
// ========== ========== ========== ========== ==========
// API 1.0 (/api10/)
// URL: /api/10/
// Behavior: Information about the 1.0 API
// Case Management
// URL: /api/10/cases/
// Behavior: Collection of all cases in the datastore with limited data on each
// URL: /api10/cases/[numericvalue]
// Behavior: Element of the /cases/ collection (single case) returning more data
// Driver Management
// URL: /api/10/drivers/
// Behavior: Collection of all drivers in the datastore with limited data on each
// URL: /api/10/drivers/[numericvalue]
// Behavior: Element of the /drivers/ collection (single driver) returning more data
// ========== ========== ========== ========== ==========
w.Header().Set("Content-Type", "text/html; charset=utf-8") // TODO: json output
fmt.Fprint(w, output)
}
// ========== ========== ========== ========== ==========