|
|
||
|---|---|---|
| common | ||
| config | ||
| core | ||
| database | ||
| document | ||
| route | ||
| server | ||
| storage/2025/8-August/qrcode | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| Dockerfile | ||
| README.md | ||
| deploy.sh | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| woodpecker.yml | ||
README.md
Build
Requires go 1.24.3 and later (as specified in go.mod).
Windows
C:\> go build -o iralex-einvoice.exe
Linux & MacOS
Todo...
Usage
- Create the required environment variables according to the
.env.examplefile. If not provided, the application aborts. - Run the program:
root@ubuntu:~$ iralex-einvoice.exe Listening on http://0.0.0.0:1404 - The
GET /pingroute can be used to check if the server is running properly. - The
GET /submitroute can be used to submit an invoice. The body must have the necessary invoice data to submit.
Port
You can specify the port the application listens on. There are two ways to do this. You can either specify the PORT environment variable.
Linux and MacOS:
export PORT=8080
Windows:
set PORT=8080
.env File:
PORT=8080
Or you can specify the port inline using the -port command-line argument:
root@ubuntu:~$ iralex-einvoice.exe -port=8080
Listening on http://0.0.0.0:8080
Note that -port (command-line argument) has a higher priority than PORT (environment variable). So specifying -port overwrites everything else. If nothing is specified, a default port will be opened.
Module Structure
common: Contains common types for use between packages in order to avoid cyclic dependencies. This package should not depend on any other package except those from the standard library or third-party libraries.config: Some configurations for the application, such as default timeout, default port, debug mode, etc.core: Core functionalities, including logging, environment variables, command-line arguments, disk operations, and a very simple file-based caching system.document: Document generation, signing, etc.route: The third-party API routes the application calls into, such as those of Iralex and LHDN.server: A simple HTTP server.