-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add route for generate api key Signed-off-by: cbh778899 <[email protected]> * update doc Signed-off-by: cbh778899 <[email protected]> --------- Signed-off-by: cbh778899 <[email protected]>
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
import { Router } from "express"; | ||
import { generateAPIKey } from "../tools/generator.js"; | ||
|
||
export default function tokenRoute() { | ||
const router = Router(); | ||
|
||
router.get('/api-key', (_, res)=>{ | ||
res.send({api_key: generateAPIKey()}) | ||
}) | ||
|
||
return router; | ||
} |