const router = require('express').Router(); const homeController = require('../controller/home.js'); const dash = require('../controller/dashboard.js'); const api = require('../controller/api.js'); module.exports = (io, bot)=> { router.route('/').get(homeController.home(io)); router.route('/redirect').get(homeController.redirect) router.route('/api/getUser').post(api.getUser(io)); router.route('/api/getGuildData/').post(api.guildData(io, bot)); router.route('/api/Change/').post(api.updateGuild(io)); router.route('/api/getRules').get(api.getRules); router.route('/api/getFeeds').get(api.getFeeds); router.route('/api/getFeed').get(api.getFeed); router.route('/api/deleteFeed').post(api.deleteFeed); router.route('/api/addFeed').post(api.addFeed(bot)); router.route('/api/updateFeed').post(api.addFeed(bot)); router.route('/api/getMessage').get(api.getMessage(bot)); router.route('/api/getChannelName').get(api.getChannelName); router.route('/api/checkChannel').get(api.checkChannel); router.route('/api/updateRule').post(api.updateRule(bot)); router.route('/api/deleteRule').post(api.deleteRule); router.route('/dashboard').get(dash.get(io)) .post(dash.post(io)); router.route('/getMessage').get(api.getMessage(bot)); //! Using ? on a param makes it optional router.route('/strikes/:id/:userid/:strikeid?').get(api.strikeDashboard(bot)) .post(api.getStrikes(bot)) .put(api.updateStrikes(bot)) .delete(api.deleteStrikes(bot)); router.route('/dc').get(homeController.dc); router.route('/addtodiscord').get(homeController.addtodiscord) return router; };