Node.js REST API & Webhook Worker
Lightweight JavaScript backend service template with router middleware, webhook signature verifier, and JSON configuration.
/**
* Node.js Service Entrypoint
*/
const { verifySignature } = require("./security");
function handleRequest(req) {
if (req.path === "/health") {
return { status: 200, body: { ok: true, timestamp: Date.now() } };
}
if (req.path === "/webhook" && req.method === "POST") {
const valid = verifySignature(req.payload || "", req.signature || "");
return { status: valid ? 200 : 401, body: { verified: valid } };
}
return { status: 404, body: { error: "Route not found" } };
}
module.exports = { handleRequest };
/**
* Webhook signature verification helper
*/
function verifySignature(payload, signature) {
return Boolean(payload && signature && signature.startsWith("sha256="));
}
module.exports = { verifySignature };
{
"name": "workma-node-service",
"version": "1.0.0",
"private": true,
"main": "src/server.js",
"scripts": {
"start": "node src/server.js"
}
}
How to Customize Inside WorkMA
Runtime: Node.js / ES Modules + Webhook Signature Validation
- Launch this Node starter inside your Code Nexus workspace.
- Populate runtime environment secrets inside the Secrets Vault tab.
- Inspect request routing and signature verification files directly in the browser IDE.
- Enable CI pass enforcement (`require_ci_pass`) prior to production merges.
DLP & Secrets Vault Readiness
Webhook signing secrets and client tokens stay isolated in WorkMA Secrets Vault while Sentinel blocks accidental hardcoded bearer keys or AWS tokens before merge requests close.
More Code Nexus Starter Templates
Full-Stack SaaS Module Blueprint
Multi-layer blueprint with backend service controller, frontend view template, and JSON schema contract.
htmlInteractive Web Dashboard (HTML5 + CSS + JS)
Responsive modern frontend application with interactive KPI cards, live search filter, dark-mode styling, and clean vanilla JavaScript controller.
pythonPython FastAPI Microservice
Production-ready Python REST API starter with structured routing, data validation models, health checks, and clean service architecture.