diff --git a/package.json b/package.json index 9790af9..7a8f75c 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dev": "next dev", "pre-build": "git init && git submodule init && git submodule update --remote", "build": "npm run pre-build && next build", - "start": "next start | (sleep 1; wget http://localhost:3000/api/v2 -O /dev/null)", + "start": "next start | (sleep 1; wget http://localhost:3000/api/v2/management/load -O /dev/null)", "lint": "eslint --ext ts,tsx .", "prettier": "prettier --write **/*", "lint:fix": "eslint --ext ts,tsx . --fix", diff --git a/pages/api/v2/index.ts b/pages/api/v2/index.ts index bca08d2..1aa982b 100644 --- a/pages/api/v2/index.ts +++ b/pages/api/v2/index.ts @@ -1,9 +1,7 @@ import { NextApiHandler } from 'next' -import { getMainGuild } from '@utils/DiscordBot' import RequestHandler from '@utils/RequestHandler' -const HelloWorld: NextApiHandler = RequestHandler().all(async (req, res) => { - getMainGuild() // Load Discord Bot +const HelloWorld: NextApiHandler = RequestHandler().all(async (_req, res) => { res.status(200).json({ happy: 'hacking' }) }) diff --git a/pages/api/v2/management/load.ts b/pages/api/v2/management/load.ts new file mode 100644 index 0000000..815acce --- /dev/null +++ b/pages/api/v2/management/load.ts @@ -0,0 +1,11 @@ + +import { NextApiHandler } from 'next' +import { getMainGuild } from '@utils/DiscordBot' +import RequestHandler from '@utils/RequestHandler' + +const LoadAPI: NextApiHandler = RequestHandler().get(async (req, res) => { + getMainGuild() // Load Discord Bot + res.status(200).json({ load: 'success' }) +}) + +export default LoadAPI