generated from ttipo/project-base
b1c6e6c7b6
아임웹 관리자 전용 페이지의 코드 위젯에 붙여 쓰는 단일 HTML 화면이다. 개요·회원 목록·신청 내역·연동 관리 메뉴로 구성하고, 회원 그룹·신청 상품은 항상 펼쳐 둔 칩으로 거른다. 로컬 확인용 정적 서버와 설치·운영 안내를 함께 둔다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
42 lines
1.4 KiB
JavaScript
42 lines
1.4 KiB
JavaScript
/**
|
|
* 로컬 테스트용 정적 서버 — imweb-members.html 을 아임웹 페이지처럼 감싸서 띄운다.
|
|
*
|
|
* node imweb/serve-local.js → http://localhost:5173/imweb-members.html
|
|
*
|
|
* 포트 5173 은 백엔드 CORS 기본 허용 주소(FRONTEND_URL)와 루트 env 의
|
|
* IMWEB_ADMIN_PAGE_URL 에 맞춘 것이다. 바꾸면 두 곳도 함께 바꿔야 한다.
|
|
*/
|
|
const http = require('http');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const PORT = 5173;
|
|
const PAGE = 'imweb-members.html';
|
|
|
|
http
|
|
.createServer((req, res) => {
|
|
const name = path.basename(new URL(req.url, 'http://localhost').pathname) || PAGE;
|
|
if (name !== PAGE) {
|
|
res.writeHead(302, { Location: `/${PAGE}` });
|
|
res.end();
|
|
return;
|
|
}
|
|
fs.readFile(path.join(__dirname, PAGE), 'utf8', (err, html) => {
|
|
if (err) {
|
|
res.writeHead(500);
|
|
res.end(String(err));
|
|
return;
|
|
}
|
|
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
|
|
res.end(
|
|
'<!doctype html><html lang="ko"><head><meta charset="utf-8">' +
|
|
'<meta name="viewport" content="width=device-width,initial-scale=1">' +
|
|
'<title>회원 유입경로 (로컬)</title></head>' +
|
|
`<body style="margin:0;padding:24px 0;background:#fff">${html}</body></html>`,
|
|
);
|
|
});
|
|
})
|
|
.listen(PORT, '127.0.0.1', () => {
|
|
process.stdout.write(`http://localhost:${PORT}/${PAGE}\n`);
|
|
});
|