-
Notifications
You must be signed in to change notification settings - Fork 2
/
api.tpl
35 lines (27 loc) · 875 Bytes
/
api.tpl
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
<< range .Service.Groups >>
<<- range .Routes >>
###
<<- $methodName := .Method ->>
<<- if eq $methodName "get" >>
<<- template "method_get" . >>
<<- else if eq $methodName "post" >>
<<- template "method_post" . >>
<<- else if eq $methodName "delete" >>
<<- template "method_delete" . >>
<<- end ->>
<< end >>
<< end ->>
<<- define "method_get" >>
# @name << .Handler >> << .JoinedDoc >>
<<toUpper .Method>> {{$dotenv baseUrl}}<<.Path>> HTTP/1.1
<<- end ->>
<<- define "method_post" >>
# @name << .Handler >> << .JoinedDoc >>
<<toUpper .Method>> {{$dotenv baseUrl}}<<.Path>> HTTP/1.1
Content-Type: <<contentType .>>
<< genTypes . >>
<<- end ->>
<<- define "method_delete" >>
# @name << .Handler >> << .JoinedDoc >>
<<toUpper .Method>> {{baseUrl}}<<.Path>> HTTP/1.1
<<- end ->>