Strips cors and does basic caching
Go to file
Adam d8286281ff adding readme file 2023-09-06 20:26:52 -05:00
nginx-conf got caching working 2023-09-06 19:48:14 -05:00
.gitignore updating ignore file 2023-09-06 16:50:18 -05:00
README.md adding readme file 2023-09-06 20:26:52 -05:00
docker-compose.yml got caching working 2023-09-06 19:48:14 -05:00
index.html adding readme file 2023-09-06 20:26:52 -05:00
index.js adding test html file 2023-09-06 14:48:32 -05:00
package-lock.json express hello world 2023-09-06 14:16:33 -05:00
package.json express hello world 2023-09-06 14:16:33 -05:00

README.md

CORS-Proxy-NGINX

Proof of Concept

Static HTML page that uses ajax to request api respose from express service through nginx proxy. If the ajax requests the api directly it should fail with a cors error. The api increments a number everytime the express server responds so you should know that the cached version is being hit if the response does not increment

Steps to run

  1. Build the sample api project npm install
  2. start the sample api npm start
  3. Start the nginx docker container docker compose up
  4. Find local ip address ifconfig en0|grep inet|awk '{print $2}'
  5. Update ajax request in index.html to point to your docker container
  6. Open index.html and refresh to verify value is not incrementing
  7. Wait 15 seconds and value should increment