This is a simple Go program that sets up a web server to serve images. It allows you to resize images dynamically based on query parameters.
To run this program, you need to have Go installed on your machine.
-
Clone the repository:
git clone https://github.com/asikarwar007/image-server.git
-
Change to the project directory:
cd image-server
-
Build the executable:
go build
-
Run the program:
./image-server
The server will start listening on port 8080. You can access it by opening a web browser and navigating to http://localhost:8080/.
Once the server is running, you can access the images using the following URL pattern:
http://localhost:8080/image-name.jpg?w=300&h=200&q=80
- image-name.jpg should be replaced with the name of the image file you want to retrieve.
- w (optional) specifies the desired width of the image.
- h (optional) specifies the desired height of the image.
- q (optional) specifies the desired quality of the image.
This project is licensed under the MIT License.
- Feel free to customize the content and sections as per your project's requirements. Don't forget to include a license file (e.g.,
LICENSE
) in your repository and update the link in the README accordingly.