This is a Go project that provides APIs for converting files.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Go (version 1.22.2 or later)
- Docker
- ImageMagick
- LibreOffice
- Clone the repository:
git clone https://github.com/Secar98/go-converter.git
- Navigate to the project directory:
cd go-converter
- Download the Go dependencies:
go mod download
You can run the application using the go run
command:
go run main.go
The application will start a server on port 8080.
This project includes a Dockerfile for building a Docker image of the application. You can build the image using the following command:
docker build -t go-converter .
And then run the image with:
docker run -rm -p 8080:8080 go-converter
This will start the application inside a Docker container and map port 8080 of the container to port 8080 on your host machine.
You can also use the docker-compose file:
docker-compose up
POST /convert
: Converts a file.POST /convert-img
: Converts an image file.GET /metrics
: Returns Prometheus metrics.