No description
- JavaScript 44.3%
- Go 30.6%
- CSS 14.4%
- HTML 10.7%
| app.js | ||
| dbdfinder.exe | ||
| go.mod | ||
| index.html | ||
| main.go | ||
| network_dbd_data.json | ||
| README.md | ||
| styles.css | ||
DBD Finder — Go Backend + Power Automate
Quick Start
# Build and run
go build -o dbdfinder.exe .
.\dbdfinder.exe
The server starts on http://localhost:8080 by default.
Environment Variables
| Variable | Default | Description |
|---|---|---|
PORT |
8080 |
HTTP listen port |
SEED_FILE |
network_dbd_data.json |
Path to initial JSON data file loaded on startup |
STATIC_DIR |
. |
Directory containing index.html, styles.css, app.js |
WEBHOOK_SECRET |
(empty — no auth) | Shared secret for Power Automate webhook auth |
API Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/data |
Returns combined DBD + NW HW data as JSON |
| POST | /api/webhook/sharepoint |
Receives data updates from Power Automate |
| GET | /api/health |
Health check |
| GET | / |
Serves the frontend (static files) |
Power Automate Setup
Goal
When the DBD list file on SharePoint is updated, Power Automate calls the Go backend webhook to refresh the in-memory data automatically.
Flow Design
Trigger
- "When a file is modified" (SharePoint connector)
- Site: your SharePoint site
- Library: the document library where the DBD list lives
- File: path to the Excel/CSV file
Actions
-
Get file content (SharePoint connector)
- Site: same
- File Identifier: use the file path from the trigger
-
Parse / Transform the data
Depending on your file format:If the SharePoint file is CSV:
Compose action → convert file content to stringIf the SharePoint file is Excel (.xlsx):
- Use "List rows present in a table" (Excel Online connector)
- This gives you an array of JSON row objects
-
HTTP action → POST to your Go backend
- Method: POST
- URI:
https://<your-server>/api/webhook/sharepoint - Headers:
Content-Type: application/json Authorization: Bearer <your-WEBHOOK_SECRET> - Body (JSON rows from Excel):
{ "dataset": "nw_hw", "rows": @{body('List_rows_present_in_a_table')?['value']} } - Body (CSV text):
{ "dataset": "nw_hw", "csv": "@{body('Get_file_content')}" }
Updating Both Datasets
If you have two sheets/files (NW HW and DBD List), create two flows or use two HTTP actions:
- First HTTP POST with
"dataset": "nw_hw"+ the NW HW rows - Second HTTP POST with
"dataset": "dbd_list"+ the DBD List rows
Authentication
Set the WEBHOOK_SECRET environment variable on your server:
$env:WEBHOOK_SECRET = "your-strong-random-secret-here"
.\dbdfinder.exe
Then configure the Power Automate HTTP action to send the header:
Authorization: Bearer your-strong-random-secret-here
Deploying
Run locally
$env:WEBHOOK_SECRET = "mysecret"
go run main.go
Build for production
go build -o dbdfinder.exe .
# Or for Linux deployment:
$env:GOOS = "linux"; $env:GOARCH = "amd64"
go build -o dbdfinder .
Docker (optional)
FROM golang:1.22-alpine AS build
WORKDIR /app
COPY go.mod main.go ./
RUN go build -o dbdfinder .
FROM alpine:3.19
WORKDIR /app
COPY --from=build /app/dbdfinder .
COPY index.html styles.css app.js ./
COPY network_dbd_data.json ./
EXPOSE 8080
CMD ["./dbdfinder"]