-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgeo-tools.yml
51 lines (51 loc) · 1.26 KB
/
geo-tools.yml
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
50
51
host: "0.0.0.0"
port: 9900
pretty_json: true
endpoints:
-
path: "/info"
methods:
GET:
type: "info"
-
# commented gid query-params usage and replaced with url params
# path: "/geo/gid"
path: "/geo/gid/{gid:GC[A-Z0-9]+}"
methods:
GET:
query_params:
return_params: false
params:
# -
# name: "gid"
# regexp: "^GC[A-Z0-9]+$"
# default: "GC74NPG"
-
name: "format"
regexp: "^[A-Z0-9a-z_]+$"
default: "unicsv"
type: "shell"
config:
single_result: 0
output: "raw"
commands:
-
chdir: "/tmp"
# command: "geo-gid -o {{.query.format}} {{.query.gid}}"
command: "geo-gid -o {{.query.format}} {{.url.gid}}"
format: "text"
return_command: false
-
path: "/geo/gidhtml/{gid:GC[A-Z0-9]+}"
methods:
GET:
type: "shell"
config:
single_result: 0
output: "raw"
commands:
-
chdir: "/tmp"
command: "geo-gid -H /tmp {{.url.gid}}>/dev/null && cat /tmp/{{.url.gid}}.html"
format: "text"
return_command: false