OSCQueryApp
August 31, 2018 ยท View on GitHub
An HTML, Javascript, css application for retrieving OSCQuery responses (in json) and rendering an appropriate webapp.
Proposal
See https://github.com/mrRay/OSCQueryProposal
Static deployment
- Copy web/views/pages/index.ejs to index.html
- In index.html, replace
<%= host_url %>with the OSCQuery server, which serves the json feed. (TODO: How to improve this?) - Serve this modified
index.html - Serve dist/bundle.js at the path
/bundle.js - Serve assets/css/style.css at the path
/css/style.css - (No need to serve assets/img, the images get built into the bundle.js)
Building for development
- Install npm
npm install- use npm to install dependenciesnpm run build- execute webpack to build output/bundle.js
When development is complete, copy output/bundle.js to dist/bundle.js.
Running node.js development server
export SERVER_URL=http://127.0.0.1:2345(OSCQuery Server)cd webnode server.js
Open your browser and go nativate to http://localhost:5050
Tests
npm run test
CORS Security
Javascript running in-browser cannot make cross-origin requests unless the server being contacted sets the HTTP header "Access-Control-Allow-Origin: *".
If the server does not set this header, as a temporary workaround, you can install this Chrome extension.
Otherwise, the json request will be blocked by Chrome's security policy.
License
This project is licensed under the MIT License and is free to use. See the included license document for more information.