Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/assos ep #46

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions backend/controllers/Assos.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import express from "express";
import assos from "../data/assos.json";

class AssosController {
/**
* Get all assos
* @server HTTP
*
* @param req The Express request object
* @param res The Express response object
*/
public static async getAssos(req: express.Request, res: express.Response) {
res.json(assos);
}
}

export default AssosController;
2 changes: 1 addition & 1 deletion backend/controllers/Goofy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class GoofyController {
private static _tracks: string[] = [];

/**
* Get the canvas image
* Get the admin page
* @server HTTP
*
* @param req The Express request object
Expand Down
8 changes: 6 additions & 2 deletions backend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import http from "http";
import { Socket } from "socket.io";
import dotenv from "dotenv";
import WSS from "./server/Websocket";

import verifyUser from "./middlewares/verifyUser";
import verifyAdmin from "./middlewares/verifyAdmin";

import AccountController from "./controllers/Account";
import CanvasController from "./controllers/Canvas";
import ChatController from "./controllers/Chat";
import verifyUser from "./middlewares/verifyUser";
import verifyAdmin from "./middlewares/verifyAdmin";
import GoofyController from "./controllers/Goofy";
import AssosController from "./controllers/Assos";

// Load environment variables from .env file
dotenv.config();
Expand Down Expand Up @@ -65,6 +68,7 @@ router.post("/canvas/countdown", CanvasController.changePixelPlacementCooldown);
router.post("/canvas/palette", CanvasController.editCanvasColorPalette);

app.get("/admin", GoofyController.getAdminPage);
app.get("/assos", AssosController.getAssos);

// Start the server
const port = process.env.PORT || 3000;
Expand Down
Loading
Loading