{"id":29227486,"url":"https://github.com/opendds/node-opendds-rest-demo","last_synced_at":"2025-07-03T09:34:05.881Z","repository":{"id":90793186,"uuid":"536277856","full_name":"OpenDDS/node-opendds-rest-demo","owner":"OpenDDS","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-06T16:23:17.000Z","size":30,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-05T22:03:54.831Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenDDS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-13T19:23:27.000Z","updated_at":"2024-09-06T16:19:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"8f18e279-ae3f-4c06-87c8-3877a778fe76","html_url":"https://github.com/OpenDDS/node-opendds-rest-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OpenDDS/node-opendds-rest-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenDDS%2Fnode-opendds-rest-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenDDS%2Fnode-opendds-rest-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenDDS%2Fnode-opendds-rest-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenDDS%2Fnode-opendds-rest-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenDDS","download_url":"https://codeload.github.com/OpenDDS/node-opendds-rest-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenDDS%2Fnode-opendds-rest-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263301178,"owners_count":23445337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-03T09:34:05.079Z","updated_at":"2025-07-03T09:34:05.856Z","avatar_url":"https://github.com/OpenDDS.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Demonstration of using node-opendds to build a custom REST-to-DDS bridge\n\nThis is a very simple example of using node-opendds (the Node.js bindings for OpenDDS) in order to build a custom\nbridge between RESTful web services and DDS. The premise of this demo is based on a multiplayer game in which a\nsingle C++ 'control' application communicates using DDS with several Node.js 'server' bridge applications. Players\nmay simply point a javascript capable browser at a running server (default port of 3210) in order to pull down a\nlightweight client web application in order to join the game.\n\nThe emphasis of this demo is to show how simple HTTP requests ('PUT', 'GET', 'DELETE') may be used to interact with\nDDS sample instances via a bridgine application, and as a result polling is used in order to get notifications of\nchanges to game states. For real-world applications, this is obviously not ideal and some kind of asynchronous push\nnotification (e.g. websockets) would most likely be used for the sake of performance and user experience.\n\n## Building the Demo\n\n1. Set up the OpenDDS environment variables (DDS_ROOT, TAO_ROOT, ACE_ROOT etc)\n2. Update PATH to include OpenDDS/bin\n3. Update LD_LIBRARY_PATH (or similar) to include lib subdirectories of ACE_ROOT and DDS_ROOT\n    * Note: the preceeding steps can be done in one command by sourcing OpenDDS's setenv.sh/setenv.cmd script\n4. Set the environment variable DEMO_ROOT to point to the root of this repository\n5. Generate project files using mwc. Assuming `gnuace`:\n```\n  opendds_mwc.pl node-opendds-rest-demo.mwc\n```\n6. Build C++ IDL library and `control` application. Again, assuming 'gnuace':\n```\n  make depend \u0026\u0026 make\n```\n Note: `make depend` is only needed if IDL / source code will be modified after its built\n    * For Visual C++: build the generated solution\n7. Build Node.js `server` application\n```\n  cd server\n  npm install\n  cd ..\n```\n* For Visual C++: add `--debug --lib_suffix=d` after `npm install` if using a Debug configuration\n\n## Running the Demo\n\nFor this step, you'll likely want to spawn multiple consoles / terminals in order to run both the client and the server\nat the same time. Generally speaking, you hopefully shouldn't ever need to restart the control application.\n\n### Single Server\n\n1. Run the control application. Assuming some flavor of Linux/UNIX:\n```\n  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DEMO_ROOT/lib\n  control/control -DCPSConfigFile rtps.ini\n```\nAnd for Windows:\n```\n  set PATH=%PATH%;%DEMO_ROOT%\\lib\n  control\\control -DCPSConfigFile rtps.ini\n```\n2. Run the server application\n```\n  cd server\n  node main.js -DCPSConfigFile ../rtps.ini\n```\n3. Navigate a javascript-enabled web browser to [http://localhost:3210](http://localhost:3210)\n\n### Multiple Servers\n\nSame as the steps above, though you will obviously need to launch multiple 'server' applications running on different\nports (use the `--port \u003cPORT\u003e` option) as well as have multiple browser tabs open to connect to each of the servers.\n\n### Misc\n\nAdditionally, this demo also exists in a form that supports websockets interactions between client and server. Check out the `websockets` branch if you're interested in seeing those improvements.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopendds%2Fnode-opendds-rest-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopendds%2Fnode-opendds-rest-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopendds%2Fnode-opendds-rest-demo/lists"}