https://github.com/bujosa/code-generator
This is a simple project for code generator
https://github.com/bujosa/code-generator
code-generator qr-code-generator rust
Last synced: over 1 year ago
JSON representation
This is a simple project for code generator
- Host: GitHub
- URL: https://github.com/bujosa/code-generator
- Owner: bujosa
- License: mit
- Created: 2023-11-18T01:57:57.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-03T01:29:08.000Z (over 2 years ago)
- Last Synced: 2025-03-11T10:53:20.085Z (over 1 year ago)
- Topics: code-generator, qr-code-generator, rust
- Language: Rust
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# code-generator
This is a simple project for generating QR codes from text.
## Description
This project uses the Actix web framework and the `qrcode_generator` crate to create a web server that generates QR codes. It exposes a POST endpoint at "/qr" that accepts JSON data with a "text" field. The server generates a QR code from this text and returns the QR code as a PNG image.
## How to use
First, clone the repository and navigate into the project directory. Then, run the server using Cargo:
```bash
cargo run
```
Once the server is running, you can generate a QR code by sending a POST request to "http://localhost:8080/qr" with JSON data containing the text. Here's an example using curl:
```bash
curl -X POST -H "Content-Type: application/json" -d '{"text":"Hello, world!"}' http://localhost:8080/qr > qrcode.png
```
This command sends a POST request with the text "Hello, world!" and saves the returned QR code to a file named "qrcode.png".
## Dependencies
* [Actix Web](https://actix.rs/)
* [qrcode_generator](https://crates.io/crates/qrcode_generator)
## License
[MIT](LICENSE)