From d8286281ffb766612b20c7239812b6b1e6426b52 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 6 Sep 2023 20:26:52 -0500 Subject: [PATCH] adding readme file --- README.md | 15 +++++++++++++++ index.html | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c2077fa --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# 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``` +1. start the sample api ```npm start``` +1. Start the nginx docker container ```docker compose up``` +2. Find local ip address ```ifconfig en0|grep inet|awk '{print $2}'``` +3. Update ajax request in index.html to point to your docker container +4. Open index.html and refresh to verify value is not incrementing +5. Wait 15 seconds and value should increment diff --git a/index.html b/index.html index 8933bb7..627b8a4 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@ Response: