kgpmask / MASK

The website for the Manga and Anime Society Kharagpur.
https://kgpmask.club
Mozilla Public License 2.0
11 stars 4 forks source link

Router Organization #159

Closed Goose-Of-War closed 1 year ago

Goose-Of-War commented 1 year ago

Here's what the beginning of our route.js file looks like right now:

const checkerRouter = require("../routes/checker");
const corsProxyRouter = require("../routes/corsProxy");
const govPortalRouter = require("../routes/govportal");
const gitHookRouter = require("../routes/git-hook");
const homeRouter = require("../routes/home");
const liveRouter = require("../routes/live");
const mediaRouter = require("../routes/media");
const membersRouter = require("../routes/members");
const miscRouter = require("../routes/misc");
const newsletterRouter = require("../routes/newsletter");
const pollRouter = require("../routes/polls");
const profileRouter = require("../routes/profile");
const quizzesRouter = require("../routes/quizzes");
const userRouter = require("../routes/user");
const eventsRouter = require("../routes/py-events");

As you can imagine... that's a lot of stuff. And when we proceed with more branched routes (for instance /gov-portal/poll/add-poll, the number of routers will just increase...

We need a better way of organizing this. I have an idea which I am open to share

PartMan7 commented 1 year ago

fs.readdir Y/Y

Goose-Of-War commented 1 year ago

(spoiler alert ;-;)