반응형

전체 글 393

11. 클라우드 리버스 프록시 설정

구축 이유기존에는 Hosting.kr에서 도메인을 관리하면서 api.maplemworlds.kr과 maplemworlds.kr 두 도메인 모두의 요청을 로컬 PC로 전달하도록 설정해 로컬 환경에서 트래픽을 분기 처리하고 있었음.api.maplemworlds.kr 요청은 로컬에서 PM2로 실행 중인 서버로,maplemworlds.kr 요청은 Netlify에서 호스팅 중인 웹으로 전달되도록 구성했는데모든 트래픽이 로컬 컴퓨터를 한 번씩 거치기 때문인지 다른 이유때문인지 정확히는 모르겠지만, 집에서 사용하는 와이파이가 프록시 서버를 구축한 이후에 간헐적으로 끊기는 문제가 생겨 클라우드 프록시 서버를 따로 두기로 결정.옮기는게 유의미한 효과가 있을진 모르겠지만..일단 옮기긴 해놨음Cloudflare로 도메인 연..

Dev/개발 일지 2025.11.06

Github Pages next.js 에셋 404 뜰 때

원인GitHub Pages는 기본적으로 Jekyll이라는 정적 사이트 생성기를 사용합니다.그리고 Jekyll은 _next/, _site/, _includes/처럼 밑줄(_)로 시작하는 폴더를 무시합니다.즉, _next/ 폴더가 있어도 서빙되지 않습니다.해결 방법: .nojekyll 파일 추가.nojekyll이라는 빈 파일을 GitHub Pages 루트에 추가하면 Jekyll 처리를 비활성화할 수 있습니다.touch docs/.nojekyllgit add docs/.nojekyllgit commit -m "fix: add .nojekyll to serve _next static files"git push origin main

Dev/etc. 2025.06.02

JWT 인증과 인가 흐름

JWT 인증과 인가 흐름1. Axios 인터셉터를 활용한 자동 토큰 갱신 예시Axios 인터셉터 설정Axios를 사용하여 Access Token의 만료를 감지하고, Refresh Token을 사용하여 새로운 Access Token을 발급받는 방식으로 자동화할 수 있음.import axios from 'axios';// Axios 인스턴스 생성const api = axios.create({ baseURL: 'https://example.com/api', timeout: 10000, headers: { 'Content-Type': 'application/json' },});// 요청 인터셉터 (요청이 보내지기 전에 처리)api.interceptors.request.use( config => { ..

Dev/etc. 2025.03.12

택배 상자 꺼내기 ( Level 1, JavaScript, 2025 프로그래머스 코드챌린지 2차 예선 )

const solution = (n, w, num) => { let res = 1 const total = Math.ceil(n / w) const target = Math.ceil(num / w) const nRemain = n % w || n const numRemain = num % w || num if (total % 2 === target % 2 && nRemain total - 전체 쌓여지는 층 수target - num이 쌓인 층 수total과 target이 같은 방향인지, 반대 방향인지 확인 후 타겟의 위에 상자가 있는지 체크하는 코드를 통해 위에 없는 경우 -1을 해줌

유연근무제 ( Level 1, JavaScript, 2025 프로그래머스 코드챌린지 1차 예선 )

const timeToMin = (time) => { return Number(String(time).slice(0, -2)) * 60 + Number(String(time).slice(-2))}const solution = (schedules, timelogs, startday) => { return timelogs.filter((log, logIdx) => { return log.filter((time, timeIdx) => { if ((timeIdx + startday) % 7 === 6 || ((timeIdx + startday) % 7 === 0)) return true return timeToMin(time) 구현시간 처리하고 모듈..

반응형