Microservice to build xlsx files from json-requests.
3.3K
xlsx-builder is a lightweight microservice written in Go that allows you to easily generate XLSX spreadsheets from JSON requests.
It can be perfect dedicated solution for projects looking to isolate their spreadsheet generation logic.
This microservice leverages Go's impressive performance and memory efficiency which can be useful for applications that handle large datasets .
docker run --rm -p 8080:8080 -e HTTP_ADDR=:8080 etilite/xlsx-builder:latest
This will start the service and expose its API on port 8080.
Endpoint:
POST /api/buildRequest Body:
The request body should be a JSON object with the following structure:
[
{"data": [11, "a", 2.1]},
{"data": [22, "some-cell-data", 2, "another-cell"]}
]
Where each object in array presents a single row in table and data is array of cell values in this row.
Request Example:
Using cURL, you can make a request like this:
curl --location 'localhost:8080/api/build' \
--header 'Content-Type: application/json' \
--data '[
{"data": [11, "a", 2.1]},
{"data": [22, "some-cell-data", 2, "another-cell"]}
]' -o sheet.xlsx
Response:
The response will be a binary XLSX file with the generated content. For this particular example it is a table with 2 rows and 4 cols:
| 11 | a | 2.1 | |
| 22 | some-cell-data | 2 | another-cell |
Content type
Image
Digest
sha256:a8f7c5faa…
Size
4 MB
Last updated
over 1 year ago
docker pull etilite/xlsx-builder