2024-06-14 11:09:53 +00:00
|
|
|
import ProbeAuthorization from "../Middleware/ProbeAuthorization";
|
2023-05-02 14:29:22 +00:00
|
|
|
import Express, {
|
2024-06-14 11:09:53 +00:00
|
|
|
ExpressRequest,
|
|
|
|
ExpressResponse,
|
|
|
|
ExpressRouter,
|
|
|
|
NextFunction,
|
2024-08-07 21:50:32 +00:00
|
|
|
} from "Common/Server/Utils/Express";
|
|
|
|
import Response from "Common/Server/Utils/Response";
|
2023-05-02 14:29:22 +00:00
|
|
|
|
|
|
|
const router: ExpressRouter = Express.getRouter();
|
|
|
|
|
|
|
|
router.post(
|
2024-06-14 11:09:53 +00:00
|
|
|
"/alive",
|
|
|
|
ProbeAuthorization.isAuthorizedServiceMiddleware,
|
|
|
|
async (
|
|
|
|
req: ExpressRequest,
|
|
|
|
res: ExpressResponse,
|
|
|
|
next: NextFunction,
|
|
|
|
): Promise<void> => {
|
|
|
|
try {
|
|
|
|
// middleware marks the probe as alive.
|
|
|
|
// so we don't need to do anything here.
|
|
|
|
return Response.sendEmptySuccessResponse(req, res);
|
|
|
|
} catch (err) {
|
|
|
|
return next(err);
|
2023-05-02 14:29:22 +00:00
|
|
|
}
|
2024-06-14 11:09:53 +00:00
|
|
|
},
|
2023-05-02 14:29:22 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
export default router;
|