I’m trying to implement a routing logic with nginScript. I haven’t been
I would like to give you my feedback just in case it may help to improve
njs (from more important/blocking to less important):
- There is no way to iterate through the keys of an object. It is not
supported none of the following methods:
- for … in
- I would like to use/import nginx variables. Something like
- I miss string.split function. Probably map, reduce, and many other
methods as well.
- It would be nice to have some “singleton” support where I could set
variable that is evaluated only once (first time is required or when
is started/reloaded). It’s clear that it should not be related to
request/response but this approach would improve performance by
executing same thing for each request. It would be similar to
are satisfied only once).
“include /etc/nginx/js/*.js;” but this .js files need to include the
- It would be nice to access a cookie by name (it wouldn’t be
if I could access to a nginx var like $v.cookie_XXX).
- Logging function would be nice to help debugging.
Hope it can be helpful