1

I've been adjusting my workflow to the new AWS version of Cloud9 for a few weeks now, it's been going mostly smooth, but I hit a strange issue that I can't find any documentation on.

Whenever I try to send a GET request from the client side JavaScript, like most recently, to load in a JSON file from the public directory, I get an HTTP Error with a status code 499 ()

The primary thing I am trying to get running is a static page that loads in some JSON and renders the data in the canvas. Now, I was able to use a workaround where I just put the JSON in a separate JS file and made it a global variable instead, but that's not really Ideal.

Here are some of the specifics. AWS Cloud9 server create-react-app web server P5.js library for clientside js The JSON file in question is stored in a subdirectory of the index.html

Here's the kicker, when I publish the code to a test Production server the code works fine, this makes me think its got to be a setting in the cloud9 environment that's at fault

Error: p5.js:59833 GET https://9560a28022cd45e1a8d25f94fa86507c.vfs.cloud9.us-east-1.amazonaws.com/js/json/StarData2.json 499 () p5.httpDo @ p5.js:59833 p5.loadJSON @ p5.js:58944 (anonymous) @ p5.js:46182 preload @ sketch.js:6 (anonymous) @ p5.js:46147 p5 @ p5.js:46434 _globalInit @ p5.js:48404 load (async) 26.../core/core @ p5.js:48413 s @ p5.js:2 (anonymous) @ p5.js:2 13../color/creating_reading @ p5.js:42088 s @ p5.js:2 e @ p5.js:2 (anonymous) @ p5.js:2 (anonymous) @ p5.js:2 (anonymous) @ p5.js:2

1 Answers1

0

Same issue with AWS Cloud9 running Django development server on port 8081 and angular development server (ng serve) on standard port ($PORT). Both django and angular are working independently (can display webpages) however error 499 is returned when angular frontend tries to load backend data (JSON GET requests).

I am sharing my solution here :

BACKEND (DJANGO)

source venv/bin/activate
./manage.py runserver 0.0.0.0:8081

The backend can be accessed at http://IP:8081/

FRONTEND (ANGULAR)

ng serve --host 0.0.0.0 --port 8080 --disable-host-check

The frontend can be accessed at http://IP:8080/

Where IP is the AWS instance IP that can be checked by clicking on the Share button on the upper right corner of Cloud9 workspace.

Theo Godard
  • 348
  • 1
  • 7