Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "node server.js",
"build": "next build",
"start": "next start",
"lint": "next lint",
Expand Down
22 changes: 22 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { readFileSync } from 'fs';
import { createServer } from 'https';
import next from 'next';
import { parse } from 'url';

const dev = process.env.NODE_ENV !== 'production';
const app = next({ dev });
const handle = app.getRequestHandler();

const httpsOptions = {
key: readFileSync('./localhost-key.pem'),
cert: readFileSync('./localhost.pem'),
};

app.prepare().then(() => {
createServer(httpsOptions, (req, res) => {
const parsedUrl = parse(req.url, true);
handle(req, res, parsedUrl);
}).listen(3000, () => {
console.log('🚀 HTTPS 서버가 실행되었습니다: https://localhost:3000');
});
});
8 changes: 4 additions & 4 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import type { NextRequest } from 'next/server';

export async function middleware(request: NextRequest) {
// 인증 토큰 확인
const token = await getAccessToken();
// const token = await getAccessToken();

// 토큰이 없으면 로그인 페이지로 리다이렉트
if (!token) {
return NextResponse.redirect(new URL('/login', request.url));
}
// if (!token) {
// return NextResponse.redirect(new URL('/login', request.url));
// }

// 인증된 사용자는 요청을 계속 진행
return NextResponse.next();
Expand Down
4 changes: 2 additions & 2 deletions src/service/api/meeting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const getTopMeetings = async (
const token = await getAccessToken();

const res = await (token ? authAPI : basicAPI).get(
`${process.env.NEXT_PUBLIC_API_URL}api/v1/meetings/top`,
`${process.env.NEXT_PUBLIC_API_URL}/api/v1/meetings/top`,
{
params: { categoryTitle },
},
Expand All @@ -33,7 +33,7 @@ const getMeetings = async (
const token = await getAccessToken();

const res = await (token ? authAPI : basicAPI).post(
`${process.env.NEXT_PUBLIC_API_URL}api/v1/meetings/search?categoryTitle=${category}`,
`${process.env.NEXT_PUBLIC_API_URL}/api/v1/meetings/search?categoryTitle=${category}`,
newSearchQueryObj,
);

Expand Down
Loading