- Phase 1: tkuser에 알림 CRUD, Push/ntfy 발송, 내부 알림 API 추가 - Phase 2: notifyHelper URL을 tkuser-api:3000으로 전환 (system2, tkpurchase, tksafety, system1) - Phase 3: notification-bell.js API 도메인 tkuser로 변경 + 캐시 버스팅 v=4 - Phase 4: system1에서 알림 코드 제거 (routes, controllers, models, utils) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
20 lines
788 B
JavaScript
20 lines
788 B
JavaScript
// routes/pushSubscriptionRoutes.js
|
|
const express = require('express');
|
|
const router = express.Router();
|
|
const pushController = require('../controllers/pushSubscriptionController');
|
|
const { requireAuth } = require('../middleware/auth');
|
|
|
|
// VAPID 공개키 (인증 불필요)
|
|
router.get('/vapid-public-key', pushController.getVapidPublicKey);
|
|
|
|
// 구독/해제 (인증 필요)
|
|
router.post('/subscribe', requireAuth, pushController.subscribe);
|
|
router.delete('/unsubscribe', requireAuth, pushController.unsubscribe);
|
|
|
|
// ntfy 구독 관리
|
|
router.post('/ntfy/subscribe', requireAuth, pushController.ntfySubscribe);
|
|
router.delete('/ntfy/unsubscribe', requireAuth, pushController.ntfyUnsubscribe);
|
|
router.get('/ntfy/status', requireAuth, pushController.ntfyStatus);
|
|
|
|
module.exports = router;
|