mirror of
https://github.com/Myxelium/RandomMemerBot.git
synced 2026-04-13 18:40:36 +00:00
Add authentication endpoints & refactor
This commit is contained in:
22
client/controllers/sounds.ts
Normal file
22
client/controllers/sounds.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import express from 'express';
|
||||
import path from 'path';
|
||||
import { Handlers } from "../handlers/index";
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.delete('/sounds/:filename', (_req, res) => {
|
||||
Handlers.DeleteSoundFile(res, _req);
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns a file from the sounds folder by filename
|
||||
* @param filename - The name of the file to return.
|
||||
* @returns mp3 - The requested file.
|
||||
*/
|
||||
router.use('/sounds', express.static(path.join(__dirname, '../../sounds')));
|
||||
|
||||
router.get('/sounds', (_req, res: express.Response) => {
|
||||
return Handlers.GetSoundFiles(res);
|
||||
});
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user