An HTML, Javascript, css application for retrieving OSCQuery responses (in json) and rendering an appropriate webapp.
See https://github.com/mrRay/OSCQueryProposal
- 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)
- 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.
export SERVER_URL=http://127.0.0.1:2345
(OSCQuery Server)cd web
node server.js
Open your browser and go nativate to http://localhost:5050
npm run test
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.
This project is licensed under the MIT License and is free to use. See the included license document for more information.