{% set name = "configurable-http-proxy" %}
{% set version = "4.0.1" %}
{% set node_version = os.environ.get('NODEJS_VERSION') or '14.*' %}
{% set node_major = node_version.split('.')[0] %}
{% set build = 0 %}

package:
  name: {{ name }}
  version: {{ version }}

source:
  fn: {{ name }}-{{ version }}.tar.gz
  url: https://registry.npmjs.org/{{ name }}/-/{{ name }}-{{ version }}.tgz
  sha256: 20394d53dddb89f8f9459ce3536dd1c5fc9780c4faa7bb3fa2518d1805ddc1bb

build:
  number: {{ build }}
  string: "node{{node_major}}_{{ build}}"
  script: npm pack; npm install -g {{name}}-{{version}}.tgz  # [not win]

requirements:
  build:
    - nodejs {{node_version}}
  run:
    - nodejs {{node_version}}

test:
  commands:
    - configurable-http-proxy -h

about:
  home: https://github.com/jupyterhub/configurable-http-proxy
  license: BSD 3-Clause
  license_file: LICENSE
  summary: node-http-proxy plus a REST API

extra:
  recipe-maintainers:
    - minrk
    - willingc
