Before you begin, ensure you have met the following requirements:
- Node.js: Make sure you have Node.js installed. You can download it from Node.js official website.
- npm: npm is typically installed with Node.js. You can verify the installation by running the following commands:
node -v npm -v
-
Clone the repository:
git clone https://github.com/iArchitSharma/caching-proxy.git cd caching-proxy
-
Install the node dependencies:
npm install
To start the caching proxy server, run the following command:
node ./index.js start --port <number> --origin <url>
--port
: The port on which the caching proxy server will run.--origin
: The URL of the origin server to which the requests will be forwarded.
Example:
node ./index.js start --port 3000 --origin http://dummyjson.com
In this example, the server will start on port 3000
and forward requests to http://dummyjson.com
.
You can clear the cache by running the following command:
node ./index.js clear-cache