Code Monkey home page Code Monkey logo

forwards-history-proxy's Introduction

GUI Proxy CodeFactor codecov License badge

The GUI Proxy allows the Dojot GUI v1 to be compliant with InfluxDb, which is used in newer versions of Dojot. To archive this

Use cases

The service was tested (i.e., yielded the same results and patterns) in the following scenarios:

  • Requesting one attribute, even when it’s not mapped in dojot’s template;
  • Requesting with dateFrom, dateTo, lastN or firstN and any combination of these parameters;
  • Returning the same syntax for all type of attributes, including JSON;
  • When the attribute is not provided, the service sends back all attributes.
  • If the request does not contain a valid attribute or has empty data, then the service responds HTTP 404 (not found attribute), as it is in the original History.
  • If the request didn’t match in a route, sends back HTTP 404.
  • Apply the two converter patterns (Using one for 1 attribute and the other for all attributes requests);

Limitations or Drawbacks

  • When receiving multiple attributes, will be only used the first one.
  • If the device requested doesn't exist, the History endpoint returns HTTP 404 response with a message ‘device not found’. Now, it also gives HTTP 404 response, but with the message ‘attr not found’.

Environment variables

The environment variables are used in configuration parameters

Environment variable Description
HISTORY_URL URL to access the History service
RETRIEVER_URL URL to access the Retriever service
PORT Port for starting the service

Configuration

yarn install

Available Scripts

In the project directory, you can run:

To run

yarn start

To test

yarn test

Docker

The following command creates a docker image to be a proxy for InfluxDB, mocking the History responses.

It has three optional arguments:
 DOJOT_VERSION: Set the GUI version
 HISTORY_URL: URL to access the History service
 RETRIEVER_URL: URL to access the Retriever service
 PORT: Service's port
docker build -f Dockerfile -t [tag name] --build-arg DOJOT_VERSION=[version] --build-arg RETRIEVER_URL=[retriever url] --build-arg HISTORY_URL=[history url] --build-arg PORT=[port] .

To run the created image:

docker run -d [-n name] <tag name>

forwards-history-proxy's People

Contributors

cfrancisco avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

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.