Welcome! Log In Create A New Profile

Advanced

Re: NJS - API Calls

naidile.pn
June 03, 2019 02:10PM
Thanks, I'll check it out. Will get back to you in case of any queries.

Additionally, I would like like to know the performance of NJS as we will
be using this in production,
Which one has more performance - Lua or NJS ?

Please suggest here.


On Mon, Jun 3, 2019 at 11:33 PM Dmitry Volyntsev <xeioex@nginx.com> wrote:

>
>
> On 03.06.2019 20:43, naidile.pn wrote:
> >
> > I want to make a REST API call which is on a different server to fetch a
> > property.
> >
> > And add the property to the request from client and proxy it
>
>
> Currently you can do it using two sublocations with proxy_pass
> directives
> (http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass).
>
> --------------------
> function js_content(r) {
>
> r.subrequest("/property", reply => {
>
> if (reply.status != 200) { r.return(500, "prop failed"); return; }
>
> r.subrequest('/backend', res => {
> ...
> })
> })
> }
>
> ------------------
>
> We plan to add a Promise object this year, so in the future it will be
> less cumbersome.
>
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

NJS - API Calls

naidile.pn 311 June 03, 2019 01:30PM

Re: NJS - API Calls

Dmitry Volyntsev 157 June 03, 2019 01:40PM

Re: NJS - API Calls

naidile.pn 145 June 03, 2019 01:46PM

Re: NJS - API Calls

naidile.pn 227 June 03, 2019 01:48PM

Re: NJS - API Calls

Dmitry Volyntsev 140 June 03, 2019 02:04PM

Re: NJS - API Calls

naidile.pn 149 June 03, 2019 02:10PM

Re: NJS - API Calls

Dmitry Volyntsev 138 June 03, 2019 02:16PM

Re: NJS - API Calls

naidile.pn 141 June 03, 2019 02:22PM

Re: NJS - API Calls

naidile.pn 139 June 04, 2019 05:14AM

Re: NJS - API Calls

Dmitry Volyntsev 154 June 04, 2019 05:32AM

Re: NJS - API Calls

Dmitry Volyntsev 178 June 04, 2019 08:56AM

Re: NJS - API Calls

naidile.pn 184 June 04, 2019 02:46PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 326
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready