c0py: initial scaffolding for website registry tool
CI (SIAX Cloud) / security (push) Successful in 12s
CI (SIAX Cloud) / contracts (push) Failing after 12s
CI (SIAX Cloud) / quality (push) Failing after 8s
Deploy to Coolify / deploy (push) Failing after 2s

This commit is contained in:
2026-09-16 13:15:21 +02:00
commit e6cc719f37
58 changed files with 1131 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
import { envSchema } from "@siax/c0py-config";
export type Env = typeof envSchema;
export { envSchema };
+53
View File
@@ -0,0 +1,53 @@
import Fastify from "fastify";
import { envSchema } from "@siax/c0py-config";
async function main() {
const env = envSchema.parse(process.env);
const server = Fastify({ logger: true });
server.get("/health", async () => ({
status: "ok",
timestamp: new Date().toISOString(),
}));
server.get("/", async () => ({
name: "c0py",
version: "0.1.0",
status: "running",
}));
// Registry endpoints
server.get("/v1/c0py/registries", async () => {
return { registries: [] };
});
server.post("/v1/c0py/registries", async (request) => {
const body = (request.body as Record<string, unknown>) ?? {};
return { created: body };
});
server.get("/v1/c0py/registries/:id", async (request) => {
const { id } = request.params as Record<string, string>;
return { id };
});
// Scan endpoints
server.post("/v1/c0py/scans", async (request) => {
const body = (request.body as Record<string, unknown>) ?? {};
return { scanId: "scan-" + Date.now(), created: body };
});
server.get("/v1/c0py/scans/:id", async (request) => {
const { id } = request.params as Record<string, string>;
return { id };
});
await server.listen({ port: env.PORT, host: "0.0.0.0" });
console.log(`c0py API listening on port ${env.PORT}`);
}
main().catch((err) => {
console.error(err);
process.exit(1);
});
+1
View File
@@ -0,0 +1 @@
testTimeout: 10000,