From 3a238429249a9a0d061dc49fab4bbc3b54320314 Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Sat, 25 Mar 2023 18:28:12 -0400 Subject: oapi: root level routes --- src/api/routes/stop.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/api/routes/stop.ts') diff --git a/src/api/routes/stop.ts b/src/api/routes/stop.ts index 6a6e6277..79e132d7 100644 --- a/src/api/routes/stop.ts +++ b/src/api/routes/stop.ts @@ -16,14 +16,22 @@ along with this program. If not, see . */ -import { Router, Request, Response } from "express"; import { route } from "@spacebar/api"; +import { Request, Response, Router } from "express"; const router: Router = Router(); router.post( "/", - route({ right: "OPERATOR" }), + route({ + right: "OPERATOR", + responses: { + 200: {}, + 403: { + body: "APIErrorResponse", + }, + }, + }), async (req: Request, res: Response) => { console.log(`/stop was called by ${req.user_id} at ${new Date()}`); res.sendStatus(200); -- cgit 1.4.1