Refactor project to transition from Rust backend to Node.js with Fastify; update Dockerfile and Docker configurations for new build process; enhance local development instructions in CONTRIBUTING.md; implement health checks in Docker Compose; update pnpm-lock.yaml with new dependencies for API and shared packages; revise README.md to reflect new stack and development setup.
Build, Test, and Push CFDM Docker Image / test (push) Has been cancelled
Build, Test, and Push CFDM Docker Image / build-and-push (push) Has been cancelled
Build, Test, and Push CFDM Docker Image / create-release (push) Has been cancelled
Build, Test, and Push CFDM Docker Image / update-wiki (push) Has been cancelled

This commit is contained in:
Denozordec
2026-06-19 12:06:32 +07:00
parent 0a0a1a92f1
commit d11414666f
2065 changed files with 15782 additions and 16699 deletions
+18
View File
@@ -0,0 +1,18 @@
import type { FastifyInstance } from "fastify";
import fp from "fastify-plugin";
import { AppError, errorBody, toAppError } from "../errors.js";
async function errorHandlerPlugin(app: FastifyInstance) {
app.setErrorHandler((err, _request, reply) => {
if (reply.sent) return;
const appErr =
err.statusCode === 401
? AppError.unauthorized()
: toAppError(err);
reply.status(appErr.statusCode).send(errorBody(appErr));
});
}
export default fp(errorHandlerPlugin, { name: "error-handler" });