This Google Apps Script provides a lightweight JSON endpoint to retrieve configuration settings from a Google Spreadsheet. It is designed to expose service status metadata while filtering out specific technical details.
The service is accessible at the following URL:
https://script.google.com/macros/s/AKfycbx7ieTYTvIpJAO2DQ9zjtGG_jdCW41vh9tD8k1ozzPiCGPhBdI6XtEU70nxHj_GFZDL/exec
The script (Kod.js) performs the following actions when a GET request is received:
- Data Source: Connects to the active spreadsheet and retrieves the sheet named "Configuration".
- Data Extraction: Reads a range of 7 rows and 10 columns starting from the top-left (A1).
- Filtering: The script iterates through the columns and explicitly excludes the following headers from the JSON output:
URLPortCICD
- JSON Mapping: The first row is treated as keys, and subsequent rows are treated as values, creating an array of objects.
The endpoint returns a JSON object with a data property:
{
"data": [
{
"ColumnName": "Value",
"AnotherColumn": "AnotherValue"
}
]
}- The script uses
ContentServiceto set the MIME type toJSON. - The column processing includes a safety break if a cell is empty.
- Redundant object deletion (
delete row) is present in the source but is managed by the JavaScript garbage collector.