This is a simple Express-based image curl server that downloads and serves images from a given URL. It caches images locally and allows automatic cleanup of older files.
Make sure you have Node.js installed on your system.
- Clone this repository:
git clone https://github.com/Xyqraaa/curl-server.git cd curl-server
- Install the required dependencies:
npm install express
You can modify these variables at the top of the file:
const PORT = 3000;
const CACHE_FOLDER = path.join(__dirname, "cache");
Run the server using:
node server.js
The server will start and listen on http://localhost:3000
GET /?url=<image_url>
- url: The direct URL to an image file.
- refresh (optional): Set to
true
to force redownload of the image.
Example:
GET http://localhost:3000/?url=https://example.com/image.jpg