Load and update quests on startup

This commit is contained in:
wancat committed 2023-07-20 15:08:47 +08:00
1 parent b2173d180d
commit 3637d41529
3 files changed
+33 -7

No files matched your search

+2
View File
@@ -7,6 +7,7 @@ import swaggerUI from 'swagger-ui-express'
import socketServer from './api/socket.js'
import connectDB from './db.js'
import apiRouter from './api/routes/index.js'
import loadAndUpdateQuests from './utils/quest.js'
async function main() {
const port = 3000
@@ -14,6 +15,7 @@ async function main() {
const server = http.createServer(app)
socketServer(server)
await connectDB()
await loadAndUpdateQuests()
const file = await fs.readFile('./swagger.yaml', 'utf8')
const swaggerDocument = YAML.parse(file)