Filter json data array
{
"examples": [
{
"key": "1",
"value": "Ping"
},
{
"key": "2",
"value": "Pong"
}
],
"provinces": [{...}],
"districts": [{...}],
"subDistricts": [{...}],
}
/examples{?key}{?value}
/provinces{?no}{?key}{?translations.th.name}{?translations.en.name}{?postalCodes}{?q}
/districts{?no}{?key}{?provinceKey}{?translations.th.name}{?translations.en.name}{?q}
/subDistricts{?no}{?key}{?provinceKey}{?districtKey}{?translations.th.name}{?translations.en.name}{?postalCodes}{?q}
Sub Districts API [/subDistricts{?no}{?key}{?provinceKey}{?districtKey}{?translations.th.name}{?translations.en.name}{?postalCodes}{?q}]
-
Parameters
- no:
32
(number, optional) - retrive datano
equal32
. - key:
100508
(string, optional) - retrive datakey
equal100508
. - translations.th.name:
ท่าแร้ง
(string, optional) - retrive datatranslations.th.name
equalท่าแร้ง
. - translations.en.name:
Tha Raeng
(string, optional) - retrive datatranslations.en.name
equalTha Raeng
. - postalCodes:
10220
(string, optional) - retrive datapostalCodes
equal10220
in array. - q:
Tha
(string, optional) - search all value containTha
*when use 'q' ignore another fields and don't support in array value search
- no:
-
Response 200 (application/json)
-
Body
[ { "no": 32, "key": "100508", "provinceKey": "10", "districtKey": "1005", "postalCodes": [ 10220, 10230 ], "translations": { "th": { "name": "ท่าแร้ง" }, "en": { "name": "Tha Raeng" } } } ]
-
PORT
: default3000
DATA_URL
: default dataCACHE_TTL
: default600
-> 10 mins *cache time out(seconds)
yarn docker:build:alpine
yarn docker:build:distroless