fromis_9/backend/src/server.js
caadiq 19ba8bcddf refactor: Express에서 Fastify로 백엔드 마이그레이션
- Express → Fastify 5 프레임워크 전환
- 플러그인 기반 아키텍처로 재구성
  - plugins/db.js: MariaDB 연결 풀
  - plugins/redis.js: Redis 클라이언트
  - plugins/scheduler.js: 봇 스케줄러 (node-cron)
- 봇 설정 방식 변경: DB 테이블 → 설정 파일 (config/bots.js)
- 봇 상태 저장: DB → Redis
- YouTube/X 봇 서비스 분리 및 개선
- 날짜 유틸리티 KST 변환 수정
- 미사용 환경변수 정리

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 21:11:02 +09:00

24 lines
499 B
JavaScript

import { buildApp } from './app.js';
import config from './config/index.js';
async function start() {
const app = await buildApp();
try {
// 서버 시작
await app.listen({
port: config.server.port,
host: config.server.host,
});
// 모든 봇 스케줄 시작
await app.scheduler.startAll();
app.log.info(`서버 시작: http://${config.server.host}:${config.server.port}`);
} catch (err) {
app.log.error(err);
process.exit(1);
}
}
start();