add templating & dockerize application #2
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jonasclaes/go-thermal-printer!2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/add-templating"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull Request Overview
This PR adds templating functionality to the thermal printer application and containerizes it with Docker. The changes enable users to print receipts using template files with variable substitution instead of raw ESC/POS commands.
/print-templateAPI endpoint for template-based printingReviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
@ -0,0 +50,4 @@EXPOSE 8080# Health checkHEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \The health check uses 'wget' but the Alpine image doesn't include wget by default. Consider using 'curl' (which needs to be installed) or a simple approach like 'nc' for port checking, or install wget in the RUN command above.
@ -0,0 +56,4 @@},"italics": func(text string) string {return fmt.Sprintf("\x1B\x34\x01%s\x1B\x34\x00", text)},The 'italics' function duplicates the exact same logic as the 'italic' function. Consider removing this duplicate or making one an alias of the other to reduce code duplication.
@ -0,0 +10,4 @@{{bold (printf "Subtotal: \xD5%.2f" .subtotal)}}{{bold (printf "Tax: \xD5%.2f" .tax)}}{{bold (printf "Total: \xD5%.2f" .total)}}The currency symbol '\xD5' is a magic number. Consider making this configurable or using a named constant to improve maintainability and support multiple currencies.