Closed monopolly closed 7 years ago
Will be super to get a strong answere format from nginx
Just to return a 3 fields always:
result boolean
error string
body string
answere looks like:
//error { "result":false, "error":{ "code":405, "message":"You got an error" } } //multi response { "result":true, "body":[ {"Answere 1 from tarantool"}, {"Answere 2 from tarantool"}, {"Answere 3 from tarantool"}, ] } //single response { "result":true, "body": "Answere 1 from tarantool" }
so parser will be very simple and understandable
if result then print(body) end if not result then print(error) end
so clear and simple and not necessary to write a complex parser depends on nginx answeres) thanks!
and you'll not need a tnt_pure with this it will be pure answere always
Check v2.4.6-rc1. (https://github.com/tarantool/nginx_upstream_module#http-headers-and-status)
Will be super to get a strong answere format from nginx
Just to return a 3 fields always:
result boolean
- global, true/false depends on tarantool answereerror string
- optionalbody string
- optionalanswere looks like:
so parser will be very simple and understandable
so clear and simple and not necessary to write a complex parser depends on nginx answeres) thanks!
and you'll not need a tnt_pure with this it will be pure answere always