/
api_definition.go
43 lines (39 loc) · 951 Bytes
/
api_definition.go
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
package design
import (
. "github.com/goadesign/goa/design"
. "github.com/goadesign/goa/design/apidsl"
)
var _ = API("feedpushr", func() {
Title("The feedpushr API")
Description("A simple feed aggregator daemon with sugar on top.")
Contact(func() {
Name("Nicolas Carlier")
URL("https://github.com/ncarlier")
})
License(func() {
Name("MIT")
URL("https://github.com/ncarlier/feedpushr/blob/master/LICENSE")
})
Docs(func() {
Description("feedpushr guide")
URL("https://github.com/ncarlier/feedpusher/README.md")
})
Host("localhost:8080")
Scheme("http")
BasePath("/v1")
Origin("*", func() {
Methods("GET", "POST", "PUT", "PATCH", "DELETE")
Headers("content-type")
MaxAge(600)
Credentials()
})
ResponseTemplate(Created, func(pattern string) {
Description("Resource created")
Status(201)
Headers(func() {
Header("Location", String, "href to created resource", func() {
Pattern(pattern)
})
})
})
})