chore: changed bot load API route

This commit is contained in:
wonderlandpark 2021-06-03 15:23:25 +09:00
parent ea40ea1c10
commit a60f5d70a6
3 changed files with 13 additions and 4 deletions

View File

@ -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",

View File

@ -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' })
})

View File

@ -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