d8286281ff | ||
---|---|---|
nginx-conf | ||
.gitignore | ||
README.md | ||
docker-compose.yml | ||
index.html | ||
index.js | ||
package-lock.json | ||
package.json |
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
- Build the sample api project
npm install
- start the sample api
npm start
- Start the nginx docker container
docker compose up
- Find local ip address
ifconfig en0|grep inet|awk '{print $2}'
- Update ajax request in index.html to point to your docker container
- Open index.html and refresh to verify value is not incrementing
- Wait 15 seconds and value should increment