This repository was archived by the owner on Oct 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservices.json.example
More file actions
51 lines (51 loc) · 1.42 KB
/
services.json.example
File metadata and controls
51 lines (51 loc) · 1.42 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
50
51
{
"url": "www.example.com", // Not Working yet
"port": 9001,
"CORS": {
"allow_remote": true,
"routes": "http://localhost:8000" // * for all
},
"services": [
{
"name": "All", // This is the name you should use for requests EXAMPLE : if you want to execute this query and get the response in a JSON just use http://<your_ip>:<your_port>/All
"description": "",
"sql": "SELECT * FROM <Table>",
"params": []
},
{
"name": "Type_LastMonth_Avg", // EXAMPLE: http://<your_ip>:<your_port>/Type_LastMonth_Avg
"description": "",
"sql": "SELECT prom_lastMonth(?) as average", // This is a mysql function execution
"params": [
{
"name": "type",
"type": "integer",
"description": ""
}
]
},
{
"name": "Type_Month_Avg", // EXAMPLE: http://<your_ip>:<your_port>/Type_Month_Avg
"description": "",
"sql": "SELECT prom_month(?, ?) as average", // This is a mysql function call
"params": [
{
"name": "month",
"type": "date",
"description": "date in format 'YYYY-MM-DD'"
},
{
"name": "type",
"type": "integer",
"description": ""
}
]
}
],
"db": { // Here you can put all your mysql params [node-mysql]
"host": "localhost",
"user": "user",
"password": "password",
"database": "database_name"
}
}