Giter Site home page Giter Site logo

mylesj / nginx-njs-http-service-call Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 8 KB

An example demonstrating how njs request handlers can interact with external services.

License: MIT No Attribution

JavaScript 100.00%
nginx njs docker-compose nodejs docker

nginx-njs-http-service-call's Introduction

nginx-njs-http-service-call

An example demonstrating how njs request handlers can interact with external services.

Prerequisites

  • docker
  • docker-compose

Start

PORT=80 docker-compose up

Overview

This project consists of two containers, a client-facing nginx server and a node "ping-pong" service. The aim was to assess how njs can reliably integrate with other system components. This solution defines an internal route which an njs module can call, that reverse-proxies a web service. Note that:

  • njs cannot make arbitrary http requests itself, only locally defined sub-requests
  • the internal directive can be used inside a location block to signal that it not be exposed publicly
  • subrequest() does not understand @named routes

nginx-njs-http-service-call's People

Contributors

mylesj avatar

Watchers

 avatar

nginx-njs-http-service-call's Issues

ARCHIVED

This demonstration is stale, since writing it there is better support for standard HTTP/S fetch.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.