mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
chore: changed bot load API route
This commit is contained in:
parent
ea40ea1c10
commit
a60f5d70a6
@ -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",
|
||||
|
||||
@ -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' })
|
||||
})
|
||||
|
||||
|
||||
11
pages/api/v2/management/load.ts
Normal file
11
pages/api/v2/management/load.ts
Normal 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
|
||||
Loading…
x
Reference in New Issue
Block a user