summary refs log tree commit diff
path: root/src/api/routes/stop.ts
blob: 1b4e1da97042c0c7d0650c2f335fa25fe47ebbaf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { Router, Request, Response } from "express";
import { route } from "@fosscord/api";

const router: Router = Router();

router.post("/", route({ right: "OPERATOR" }), async (req: Request, res: Response) => {
	console.log(`/stop was called by ${req.user_id} at ${new Date()}`);
	res.sendStatus(200);
	process.kill(process.pid, "SIGTERM");
});

export default router;