Back/RT/app.js
seonkyu.kim 6a7fa38b96
All checks were successful
Stein_Back/pipeline/head This commit looks good
[] RT 서비스 연결 추가
2024-08-09 15:49:59 +09:00

25 lines
690 B
JavaScript

import express, { query } from 'express';
import { createDatabaseConnection } from '../db/database.js'; // db 연결 파일
import { HandlePush } from './push.js';
import { rtDBConfig } from '../private/config.js';
// const cmcd = "/JJ";
// const db = "/JJ/db";
const app = express();
app.use(express.json());
// DB 연결 테스트
app.get(`${db}/test`, async (req, res) => {
try {
const connection = await createDatabaseConnection(dbConfig);
const [rows] = await connection.query('SELECT * FROM version');
await connection.end();
res.json({ result: rows[0].solution });
} catch (err) {
res.status(500).json({ error: err.message });
}
});
export default app;