Giter Site home page Giter Site logo

conwetlab / ngsi-proxy Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 10.0 297 KB

Proxy allowing receiving notifications from Orion Context Broker on browser environments

License: GNU Affero General Public License v3.0

JavaScript 94.25% Dockerfile 5.66% Shell 0.09%
fiware-ngsi fiware-orion

ngsi-proxy's People

Contributors

aarranz avatar jason-fox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ngsi-proxy's Issues

Usage Documentation

NGSI-Proxy Usage Documentation

  • Create eventsource:

    curl -X POST {{ngsiproxyurl}}/eventsource
    

    Sample create eventsource response:

    { 
     "connection_id":"353529a0-281a-11ec-b25b-6d62e91d5158",
     "url":"{{ngsiproxyurl}}/eventsource/353529a0-281a-11ec-b25b-6d62e91d5158"
    }
    
  • Create callback:

    Use the previously generated connection_id to create the
    callback:

    curl -X POST '{{ngsiproxyurl}}/callbacks' \
    --data-raw '{
                "connection_id": "353529a0-281a-11ec-b25b-6d62e91d5158"
    }'
    

    Sample create callback response:

    {
     "callback_id":"40b18800-281a-11ec-b25b-6d62e91d5158",
     "url":"{{ngsiproxyurl}}/callbacks/40b18800-281a-11ec-b25b-6d62e91d5158"
    }
    
  • Consume callback:

    The callback to be notified by the context-broker through a
    subscription. Use the previously generated callback_id to create
    the callback:

    curl -X POST '{{ngsiproxyurl}}/callbacks/40b18800-281a-11ec-b25b-6d62e91d5158' \
    --data-raw '{
     	    "keyofpayloadcontent": "valueofpayloadcontent"
    }'
    
  • Sample EventSource:

    Use the url returned in "Create eventsource"

    const sse = new EventSource('{{ngsiproxyurl}}/eventsource/353529a0-281a-11ec-b25b-6d62e91d5158');
    sse.addEventListener("notification", function(e) {
      console.log(JSON.parse(e.data));
    }) 
    

    This EventSource will fire everytime the callback is consumed.

Improve documentation - API use without wirecloud

I would love to know how could it be used without Wirecloud, just as a proxy between Orion Context Broker and our custom react app.

How do we manage the Orion subscription from the proxy?

Thanks

ngsiproxy not running

I have just installed the latest ngsiproxy using this command:
docker run --name beincpps-ngsiproxy -d fiware/ngsiproxy
The docker container is running properly: docker container ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9c5ade363d3f fiware/ngsiproxy "/bin/sh -c ngsi-p..." 11 minutes ago Up 11 minutes 3000/tcp beincpps-ngsiproxy

But when trying to access in firefox the address http://localhost:3000 , the ngsiproxy is not responding and the page is not accessible.

Do you have any idea?

Thanks!

Configuration for NGSI proxy

 I have installed the latest ngsiproxy on docker container.I am not able to receive notifications from context broker in wirecloud widget though subscription is created successfully.
Is there a need of additional configuration than issuing
docker run --name some-ngsiproxy -p 3000:3000 -d fiware/ngsiproxy ?

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.