feat: startup script for loading discordbot

This commit is contained in:
Junseo Park 2021-02-25 14:56:54 +09:00
parent 9f54c6c9e6
commit 50bd98d91e
3 changed files with 4 additions and 1 deletions

View File

@ -40,4 +40,4 @@ RUN yarn build
RUN yarn build
# Running the app
CMD "yarn" "start"
CMD './startup.sh'

View File

@ -2,9 +2,11 @@ import { NextApiRequest, NextApiResponse } from 'next'
import nc from 'next-connect'
import ResponseWrapper from '@utils/ResponseWrapper'
import { getMainGuild } from '@utils/DiscordBot'
const HelloWorld = nc<NextApiRequest, NextApiResponse>()
.get(async(_req, res) => {
getMainGuild() // Load Discord Bot
return ResponseWrapper(res, { code: 200, message: '>_<' })
})

1
startup.sh Normal file
View File

@ -0,0 +1 @@
yarn start & (sleep 1; wget http://localhost:3000/api -O /dev/null)