We need to switch to providing a lightweight HTTP server so a user can go to http://localhost:9999/scanjs/client vs file:///Users/rfletcher/work/scanjs/scanjs/client/index.html
Right now, in Chrome, we have cross-origin loading errors. More importantly, we use relative file paths throughout the code. This is presenting problems and isn't really how we should be doing it.
For example:
scanjs/client/index.html and scanjs/tests/run-tests.html include scanjs/client/js/initTern.js. scanjs/client/js/initTern.js attempts to load the file js/lib/tern/defs/browser.json.
This means index.html is looking for file js/lib/tern/defs/browser.json inside scanjs/client while run-tests.html is looking for js/lib/tern/defs/browser.json inside of scanjs/tests/
If we had a lightweight HTTP server, initTern.js could simply do a
getJSON('browser', '/scanjs/client/js/lib/tern/defs/browser.json');
We need to switch to providing a lightweight HTTP server so a user can go to
http://localhost:9999/scanjs/client
vsfile:///Users/rfletcher/work/scanjs/scanjs/client/index.html
Right now, in Chrome, we have cross-origin loading errors. More importantly, we use relative file paths throughout the code. This is presenting problems and isn't really how we should be doing it.
For example:
scanjs/client/index.html
andscanjs/tests/run-tests.html
includescanjs/client/js/initTern.js
.scanjs/client/js/initTern.js
attempts to load the filejs/lib/tern/defs/browser.json
.This means
index.html
is looking for filejs/lib/tern/defs/browser.json
insidescanjs/client
whilerun-tests.html
is looking forjs/lib/tern/defs/browser.json
inside ofscanjs/tests/
If we had a lightweight HTTP server,
initTern.js
could simply do a getJSON('browser', '/scanjs/client/js/lib/tern/defs/browser.json');