qr-coder

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2024 License: MIT

README

qr-coder

docker pulls docker push go build codecov

Lightweight microservice written in Go to generate QR-codes in png format.

By default, qr-coder adds to content UTF-8 BOM prefix for better unicode-compatibility with scanners.

Usage

Quick Start with Docker
docker run --rm -p 8080:8080 -e HTTP_ADDR=:8080 etilite/qr-coder:latest

This will start the service and expose its API on port 8080.

API
Request
  • POST /generate
{
  "size": 256,
  "content": "https://github.com/etilite/qr-coder"
}
  • size in pixels of image side, int
  • content is a string to encode, string

Request Example:

Using cURL, you can make a request like this:

curl --location 'localhost:8080/generate' \
--header 'Content-Type: application/json' \
--data '{
  "size": 256,
  "content": "https://github.com/etilite/qr-coder"
}' -o img.png
Response

The response will be a binary PNG file with the encoded content.

response

Build from source
git clone https://github.com/etilite/qr-coder.git
cd qr-coder
make run

This will build and run app at http://localhost:8080.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

If you'd like to contribute to the project, please open an issue or submit a pull request on GitHub.

Directories

Path Synopsis
cmd
internal
app

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL