Add express scaffolding for backend services

This commit is contained in:
Alexa Amundson
2025-11-21 00:12:25 -06:00
parent b42da04208
commit 17ed67829b
16 changed files with 7392 additions and 0 deletions

1752
blackroad-os-agents/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
{
"name": "blackroad-os-agents",
"version": "0.1.0",
"main": "dist/index.js",
"scripts": {
"dev": "ts-node-dev --respawn --transpile-only src/index.ts",
"build": "tsc",
"start": "node dist/index.js",
"health": "curl -f http://localhost:8080/health || exit 1"
},
"dependencies": {
"express": "^4.19.0",
"cors": "^2.8.5",
"dotenv": "^16.4.5"
},
"devDependencies": {
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/node": "^20.11.0",
"ts-node-dev": "^2.0.0",
"typescript": "^5.6.0"
}
}

View File

@@ -0,0 +1,31 @@
import express from "express";
import cors from "cors";
import dotenv from "dotenv";
dotenv.config();
const app = express();
app.use(cors());
app.use(express.json());
const PORT = process.env.PORT || 8080;
const SERVICE_NAME = "blackroad-os-agents";
app.get("/", (_req, res) => {
res.json({
service: SERVICE_NAME,
status: "ok",
message: "BlackRoad OS Agents Orchestrator root"
});
});
app.get("/health", (_req, res) => {
res.json({
service: SERVICE_NAME,
status: "ok"
});
});
app.listen(PORT, () => {
console.log(`${SERVICE_NAME} listening on port ${PORT}`);
});

View File

@@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "ES2019",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src"]
}