mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-02-17 13:52:14 +01:00
10 lines
436 B
TypeScript
10 lines
436 B
TypeScript
import * as APIKey from "../../auth/apikey/apikey-controller";
|
|
import { whenAuthIsEnabled, isAuthorized } from "../../auth/authenticationMiddleware";
|
|
import express, { Request, Response } from "express";
|
|
const router = express.Router();
|
|
|
|
router.post('/create-api-key', whenAuthIsEnabled, isAuthorized, async function(req: Request, res: Response) {
|
|
res.json({apikey: await APIKey.createAPIKey(req.user)});
|
|
});
|
|
|
|
export default router; |