express

개발자의품격/팀프로젝트 4기

[Node] multer를 이용하여 서버에 단일 이미지 저장하기

프론트: React 백엔드: Node (Express) 클라이언트의 이미지를 서버에 저장하는 것을 구현하였습니다. 파일은 multipart/form-data 형식으로 서버단에 전송되어야 합니다. React // const handleChangeImageFile = async (e: ChangeEvent) => { if (!e.target.files) return; const formData = new FormData(); formData.append('file', e.target.files[0]); const res = await axios.post( 'https://domain.com/api/v1/upload/image', formData, { headers: { 'Content-Type': 'mult..

개발자의품격/팀프로젝트 4기

[Infra] Oracle Cloud + Nginx + Node(Express) reverse proxy 설정

오라클 클라우드를 이용하여 서버를 구축하던 중에 Nginx를 이용하여 리버스 프록시 설정을 진행하였습니다. 많은 자료들을 참고하여 클라우드 세팅을 진행했습니다. // etc/nginx/conf.d/[config 이름].conf location /api { proxy_pass http://[공인 IP]:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host [도메인]; proxy_cache_bypass $http_upgrade; proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_..