inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

172만명의 커뮤니티!! 함께 토론해봐요.

reset에서 head

해결됨

빠르게 git - 핵심만 골라 배우는 Git/Github

처음 head 개념을 설명해주신 코드 쳐보면서 얼추 개념을 알았다고 생각했는데 "추가자료 diff&revert" 부분을 보며 뭔가 잘못 이해한것 같아 질문드립니다. commit을 5번 했다고 할때 가장 최근에 한 commit을 삭제하려면 git reset head^ 위 명령어를 쳐야 가장 최근 커밋(5번째 커밋)이 제거되던데 왜 그런건가요?? 가장 최근 commit이 head라면 git reset head 를 입력했을때 5번째 커밋이 지워져야 하는거 아닌가요?? 테스트해본 내용 추가) 첫번째 커밋 3.txt (내용:1) 두번째 커밋 3.txt (내용:2) 세번째 커밋 3.txt (내용:3) git reset --hard head 명령어 입력시 내용이 3에서 2로 바뀌여야 하는데 그대로 3이고 git log를 찍어봐도 마지막 commit이 그대로 있습니다. 반면 git reset --hard head^ 명령어 입력시 내용이 3에서 2로 바뀌고 git log를 찍어보면 마지막 commit이 사라집니다. *diff와 revert는 설명해주신대로 잘 작동하는데 reset만 이러하네요ㅠㅠ

  • git
  • github
  • 버전관리시스템
e.h Lee 댓글 1 좋아요 0 조회수 362

git branch 관련 질문

해결됨

빠르게 git - 핵심만 골라 배우는 Git/Github

git branch를 나누어도 repository에 들어있는 즉, 커밋이 완료된 파일들만 나뉘는게 맞나요? 테스트 해봤는데 branch를 나누어도 working area랑 stage area는 공통인듯하여 질문드립니다!

  • git
  • github
  • 버전관리시스템
e.h Lee 댓글 1 좋아요 0 조회수 241

수업 ppt 자료 받고 싶습니다

해결됨

팀 개발을 위한 Git, GitHub 입문

안녕하세요 강사님 강의 잘 듣고 있습니다! 중간중간 복습용으로 강의 ppt를 받고 싶습니다 siksik2259@naver.com 이 메일로 보내주시면 감사하겠습니다!

  • git
  • github
  • 버전관리시스템
선희 이 댓글 2 좋아요 0 조회수 276

강의자료 부탁드립니다!

해결됨

팀 개발을 위한 Git, GitHub 입문

수업 이해가 잘되어서 강의자료보고 나중에 다시 깃을 쓸 때, 참고하고싶습니다!! n9805h@naver.com 입니다!!

  • git
  • github
  • 버전관리시스템
RealTone 댓글 2 좋아요 0 조회수 325

slack 초대 부탁 드립니다~

해결됨

코딩은 실전이다! - Git알못을 위한 깃린이코스(Git, Github 실습위주)

kjh950601@gmail.com 입니다. 감사합니다.

  • git
  • github
  • 버전관리시스템
jay 댓글 2 좋아요 1 조회수 242

로그인 버튼 클릭시 500에러 발생

미해결

Next + React Query로 SNS 서비스 만들기

아이디, 비밀번호를 입력하고 로그인 버튼을 누르면 500에러가 발생합니다. 9090 서버 포트는 잘 켜져있다고 뜨고, 코드 올리겠습니다. <auth.ts> import NextAuth from "next-auth"; import CredentialsProvider from "next-auth/providers/credentials"; import KakaoProvider from "next-auth/providers/kakao"; export const { handlers: { GET, POST }, auth, signIn, } = NextAuth({ pages: { signIn: "/i/flow/login", newUser: "i/flow/signup", }, providers: [ CredentialsProvider({ async authorize(credentials) { // credentials 안에 id창에서 입력하는 정보다 담겨있음 const authResponse = await fetch(`${process.env.AUTH_URL}/api/login`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ id: credentials.username, password: credentials.password, //next-auth의 credentials에는 username, password로 고정되어 있어서 이를 바꿔줌 }), }); //로그인 실패시 if (!authResponse.ok) { return null; } const user = await authResponse.json(); return user; }, }), //kakao로그인을 사용할때 // KakaoProvider(), ], }); <LoginModal.tsx> "use client"; import style from "@/app/(beforeLogin)/_component/login.module.css"; import { signIn } from "next-auth/react"; import { useRouter } from "next/navigation"; import { ChangeEventHandler, FormEventHandler, useState } from "react"; export default function LoginModal() { const [id, setId] = useState(""); const [password, setPassword] = useState(""); const [message, setMessage] = useState(""); const router = useRouter(); const onSubmit: FormEventHandler<HTMLFormElement> = async (e) => { e.preventDefault(); setMessage(""); try { await signIn("credentials", { username: id, password, redirect: false, }); //kakao, naver로 바꿀 수 있음 //client 일때는 next-auth/react의 signIn을 사용 //server 일때는 @/auth의 signIn을 사용 router.replace("/home"); } catch (error) { console.log(error); setMessage("아이디와 비밀번호가 일치하지 않습니다."); } }; const onClickClose = () => { router.back(); }; const onChangeId: ChangeEventHandler<HTMLInputElement> = (e) => { setId(e.target.value); }; const onChangePassword: ChangeEventHandler<HTMLInputElement> = (e) => { setPassword(e.target.value); }; return ( <div className={style.modalBackground}> <div className={style.modal}> <div className={style.modalHeader}> <button className={style.closeButton} onClick={onClickClose}> <svg width={24} viewBox="0 0 24 24" aria-hidden="true" className="r-18jsvk2 r-4qtqp9 r-yyyyoo r-z80fyv r-dnmrzs r-bnwqim r-1plcrui r-lrvibr r-19wmn03" > <g> <path d="M10.59 12L4.54 5.96l1.42-1.42L12 10.59l6.04-6.05 1.42 1.42L13.41 12l6.05 6.04-1.42 1.42L12 13.41l-6.04 6.05-1.42-1.42L10.59 12z"></path> </g> </svg> </button> <div>로그인하세요.</div> </div> <form onSubmit={onSubmit}> <div className={style.modalBody}> <div className={style.inputDiv}> <label className={style.inputLabel} htmlFor="id"> 아이디 </label> <input id="id" className={style.input} value={id} onChange={onChangeId} type="text" placeholder="" /> </div> <div className={style.inputDiv}> <label className={style.inputLabel} htmlFor="password"> 비밀번호 </label> <input id="password" className={style.input} value={password} onChange={onChangePassword} type="password" placeholder="" /> </div> </div> <div className={style.message}>{message}</div> <div className={style.modalFooter}> <button className={style.actionButton} disabled={!id && !password}> 로그인하기 </button> </div> </form> </div> </div> ); } <middleware.ts> export { auth as middleware } from "./auth"; export const config = { matcher: ["/compose/tweet", "/home", "/explore", "/messages", "/search"], }; <route.ts> export { GET, POST } from "@/auth"; 에러 내용 : TypeError: next_dist_server_web_exports_next_request__WEBPACK_IMPORTED_MODULE_0__ is not a constructor at reqWithEnvURL (webpack-internal:///(rsc)/./node_modules/next-auth/lib/env.js:15:12) at httpHandler (webpack-internal:///(rsc)/./node_modules/next-auth/index.js:139:139) at /Users/imhwarang/projects/zerocho/z-com/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:63815 at /Users/imhwarang/projects/zerocho/z-com/node_modules/next/dist/server/lib/trace/tracer.js:133:36 at NoopContextManager.with (/Users/imhwarang/projects/zerocho/z-com/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062) 너무 길어서 다 올릴수는 없네요 에러내용을

  • react
  • next.js
  • react-query
  • next-auth
  • msw
화랑 댓글 3 좋아요 0 조회수 1235

afterlogin beforelogin 로그인 분기처리 질문

미해결

Next + React Query로 SNS 서비스 만들기

안녕하세요. 디렉토리 구조를 afterlogin과 beforelogin구조로 나누어서 로그인을 분기치고 있고 auth.ts에서 서버로 부터 전달받은 토근값을 넣고 미들웨어에서 세션을 유무를 확인하여 login페이지로 리다이렉트 시키고 있습니다. afterlogin과 beforelogin으로 디렉토리가 어떤방식으로 나뉘는지 로직이 궁금합니다. 관련된 훅이 있는것인지?? 2. 실제 상용화된 서비스라고하면 로그인이 풀리는것을 방지하기 위해 BE로 토근값을 요청할텐데, 관련 로직은 어떤방식으로 구현하는게 좋은방법인지 요청드립니다.

  • react
  • next.js
  • react-query
  • next-auth
  • msw
댓글 1 좋아요 0 조회수 424

MacOs, PostgreSQL16 설치, pgAdmin 4에서 connection 오류

미해결

Next + React Query로 SNS 서비스 만들기

비번 확실히 틀리지 않았는데 계속 오류 뜨길래, 완전 삭제후 다시 설치해서 비번 쉬운걸로 다시 설정하고 입력해도 계속 비번오류 뜹니다.

  • react
  • next.js
  • react-query
  • next-auth
  • msw
라푼젤 댓글 4 좋아요 2 조회수 1068

chilrdren, modal의 보여지는 원리가 제가 이해한 것이 맞을까요?

미해결

Next + React Query로 SNS 서비스 만들기

안녕하세요 제로초님. 인터넷창에 직접 주소를 입력하거나 새로고침 시 뒤에 배경화면이 사라지는 것에 대하여 질문있습니다. 먼저 <Link href='/i/flow/signup' className={styles.signup}> 를 클릭 시에는 인터셉터 라우팅이 트리거 되어 src/app/(beforeLogin)/layout.tsx 에 있는 children으로 인해 배경화면에 main컴포넌트가 보여지며 인터셉터된 @modal 은 modal부분에 보여집니다. 그런데 직접 주소창에 /i/flow/signup' 를 입력하여 접근하거나 새로고침하면 배경화면에 main컴포넌트가 사라지게 되는데 이것의 이유는 직접 접근할 때 인터셉에 걸리지 않게되고, childrend에는 i/flow에 있는 폴더들이 보여지며 defalut.tsx가 배경화면으로 보여지기 때문인가요?

  • react
  • next.js
  • react-query
  • next-auth
  • msw
김건희 댓글 1 좋아요 0 조회수 494

2-3 진행 중 에러 발생

미해결

쥬쥬와 함께 하루만에 시작하는 백엔드 - 스프링, 도커, AWS

2-3 강의 중 12분 쯤에 Send를 누르면 200 OK가 떠야한다고 하셨는데 저는 500 에러가 발생합니다! package com.jyujyu.review.api; import com.jyujyu.review.service.TestService; import lombok.AllArgsConstructor; import lombok.Getter; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @AllArgsConstructor @RestController public class TestEntityApi { private final TestService testService; @PostMapping("/test/entity/create") public void createTestEntity( @RequestBody CreateTestEntityRequest request ) { testService.create(request.getName(), request.getAge()); } @AllArgsConstructor @Getter public static class CreateTestEntityRequest { private final String name; private final Integer age; } } package com.jyujyu.review.api; import com.jyujyu.review.service.TestService; import lombok.AllArgsConstructor; import lombok.Getter; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @AllArgsConstructor @RestController public class TestEntityApi { private final TestService testService; @PostMapping("/test/entity/create") public void createTestEntity( @RequestBody CreateTestEntityRequest request ) { testService.create(request.getName(), request.getAge()); } @AllArgsConstructor @Getter public static class CreateTestEntityRequest { private final String name; private final Integer age; } } package com.jyujyu.review.repository; import com.jyujyu.review.model.TestEntity; import org.springframework.data.jpa.repository.JpaRepository; public interface TestRepository extends JpaRepository<TestEntity, Long> { // Long -> TestEntity에 @Id가 있는 필드의 자료형을 작성한다. } package com.jyujyu.review.model; import jakarta.persistence.*; import lombok.Getter; @Getter @Table(name = "test") @Entity public class TestEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private Integer age; public TestEntity(String name, Integer age) { this.name = name; this.age = age; } public TestEntity() { } public void changeNameAndAge(String name, Integer age) { this.name = name; this.age = age; } } plugins { id 'java' id 'org.springframework.boot' version '3.2.2' id 'io.spring.dependency-management' version '1.1.4' } group = 'com.jyujyu' version = '0.0.1-SNAPSHOT' java { sourceCompatibility = '17' } repositories { mavenCentral() } configurations { compileOnly { extendsFrom annotationProcessor } } dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' testImplementation 'org.springframework.boot:spring-boot-starter-test' compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' runtimeOnly 'com.h2database:h2' } tasks.named('test') { useJUnitPlatform() } server.port=8081 spring.h2.console.enabled=true spring.h2.console.path=/h2-console spring.h2.console.settings.web-allow-others=true spring.datasource.driver-class-name=org.h2.Driver spring.datasource.url=jdbc:h2:mem:rss spring.datasource.username=sa spring.jpa.hibernate.ddl-auto=create spring.jpa.show-sql=true 알려주신대로 코드를 작성하고 포스트맨에서 Send를 눌러도 500 Internal Server:Error 라고 뜨네요 ㅠ 원인을 찾아봐도 안보여서 여쭙습니다..! 참고로 포트는 8081이 맞습니다 혹시 파일 필요하실까봐 링크 첨부했습니다 https://drive.google.com/file/d/1W65YQNY5rOGjWuqr-ntff7_QuTWz4eDw/view?usp=sharing

  • spring
  • git
  • docker
  • spring-boot
  • jpa
  • github
liltjay 댓글 2 좋아요 0 조회수 376

로고가 안보여요

해결됨

깃헙 블로그(Github blog)로 차별화 된 나만의 홈페이지 만들기!

로고가 안보여서 여기저기 파일 들쑤셔보니깐 오류문구가 뜨는걸 발견했습니다. 이게 로고가 안보이는 이유인지는 잘 모르겠는데 오류가 보이니 고치고 싶은데 어떻게 고치는지 모르겠습니다. gpt도 유용한 정보를 안주네요 허허...

  • 블로그
  • github
GOOSPEL 댓글 1 좋아요 0 조회수 240

msw server 구성

해결됨

Next + React Query로 SNS 서비스 만들기

안녕하세요 강사님 수업 잘듣고 있습니다 .. ! msw 쪽 수업을 듣다가 궁금한 점이 있어서 질문 남기게 되었습니다 msw 공식 홈페이지 ( https://mswjs.io/docs/integrations/node) 에서 node 관련 server 를 지원해주는데 express로 따로 https 파일을 구성하신 이유가 있으신지 궁금합니다.. ! 공식홈페이지를 따라 갈지, express로 서버를 구성해야하는지 선택이 어려워서요..! 조언을 듣고 싶습니다

  • next.js
  • msw
댓글 1 좋아요 0 조회수 233

강의자료부탁드립니다

해결됨

팀 개발을 위한 Git, GitHub 입문

강의 잘 보겠습니다 강의자료 부탁드립니다 whdudgms123@naver.com

  • git
  • github
  • 버전관리시스템
whdud 댓글 2 좋아요 0 조회수 238

웹사이트 ip주소 확인 어떻게 하는지 질문 드립니다.

해결됨

포트폴리오 초간단 배포하기

안녕하세요 강의 듣고 제가 직접 실습 해본 것 관련해서 질문 드립니다. http://raw.githack.com 으로 호스팅을 해봤는데요, 여기로 호스팅을 한 웹 사이트의 ip주소는 어떻게 확인할 수 있나요?

  • linux
  • github
  • nginx
강태훈 댓글 1 좋아요 1 조회수 823

섹션5의 2번째 강의 질문-setMap 비동기 처리 이유

미해결

비전공자를 위한 풀스택 맛집지도 만들기 프로젝트!: Front, Back-end 그리고 배포까지

제가 이해한 바가 맞는지 질문드립니다. 질문1. 마커를 찍을 시: 1. 주소를 좌표로 변환 2. 해당 좌표를 마커로 지도에 표시 의 처리 순서가 보장되어야 하므로, async await를 이용한 비동기처리를 해준 것이 맞나요? 질문 2. 비동기처리를 해주기 전에도 마커는 잘 찍혔는데, 그 말은 즉 주소를 좌표로 변환하고-> 좌표를 마커로 표시하는 순서로 코드가 실행되었다는 것 아닌가요? 그렇다면 api가 비동기적으로 이루어진다는 말이 잘 와닿지 않아서 질문드립니다. 감사합니다!

  • HTML/CSS
  • javascript
  • aws
  • git
  • mysql
  • rest-api
  • github
이다윤 댓글 1 좋아요 0 조회수 254

mac 터미널 git log 바로출력

해결됨

모두의 깃 & 깃허브

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 혹시나 강사님 처럼 터미널에서 git log 바로 출력되는 방법 찾으시는 분 있을까봐 글 남깁니다. mac에서는 git로그 기본 출력이 vi로 설정되어 있어 터미널에서 바로 확인하기 매우 불편하다.터미널에 로그를 바로 출력하기 위해서는 기본 출력을 vi에서 cat으로 변경해주면 된다.아래 명령어 그대로 터미널에 복사해주세요.git config --global core.pager cat 출처 : https://mangu.tistory.com/91

  • git
  • github
댓글 2 좋아요 1 조회수 366

깃&깃헙 브랜치 3개로 협업하기 (주니어개발자 팀프로젝트) -branch default 설정 관련

해결됨

30분 요약 강좌 시즌4 : 알잘딱깔센 GitHub

깃&깃헙 브랜치 3개로 협업하기 (주니어개발자 팀프로젝트) -branch default 설정 관련 영상을 따라하다가 막히는 부분이 있어서 질문드립니다. 안내해주신 분 잘 따라가며 repository의 setting에 들어가서 branch를 눌러보니 defualt 설정하는 곳이 안 보여서 어떻게 해야할지 몰라 질문드립니다. 이렇게 branch protection rules 만 보이는 상태입니다.

  • git
  • github
joamksh 댓글 1 좋아요 0 조회수 313

안녕하세요 마지막 강의 질문 있습니다.

미해결

따라하며 배우는 도커와 CI환경 [2023.11 업데이트]

git actions에서 EB에 배포전에, docker hub에 이미지를 미리 배포하고, 그 배포된 docker image 파일을 EB에서 실행한다고한다면, 결국 Dockerrun.aws .json 파일만 EB에 배포하면 되는 것 아닌가요? - name: Generate deployment package run: zip -r deploy.zip . -x '*.git*' 해당 코드는 소스파일과 그외 파일까지 전부 압축해서 S3에 업로드하자나요? Dockerr.aws .json 파일만 첨부해서는 작동이 안되나요?

  • aws
  • docker
  • github
  • ci/cd
  • travis-ci
  • 데이터-엔지니어링
Tk 댓글 1 좋아요 0 조회수 450

build 에러 Error occurred prerendering page

미해결

Next + React Query로 SNS 서비스 만들기

Error occurred prerendering page "/newpost". Read more: https://nextjs.org/docs/messages/prerender-error ReferenceError: document is not defined at 46593 (/Users/gyeongdeokpark/Documents/01.GitHub/codeblog/.next/server/app/newpost/page.js:2:59980) at __webpack_require__ (/Users/gyeongdeokpark/Documents/01.GitHub/codeblog/.next/server/webpack-runtime.js:1:146) at F (/Users/gyeongdeokpark/Documents/01.GitHub/codeblog/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:36:6049) at /Users/gyeongdeokpark/Documents/01.GitHub/codeblog/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:36:8464 at W._fromJSON (/Users/gyeongdeokpark/Documents/01.GitHub/codeblog/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:36:8902) at JSON.parse (<anonymous>) at L (/Users/gyeongdeokpark/Documents/01.GitHub/codeblog/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:36:5770) at t (/Users/gyeongdeokpark/Documents/01.GitHub/codeblog/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:36:12155) ✓ Generating static pages (5/5) > Export encountered errors on following paths: /newpost/page: /newpost npm run build시에 발생하는 에러입니다. 각종 사이트에서는 14버전에서 에러가 발생하고 있다고 하는 글 들만 있고 해결방법을 찾지 못했습니다.. gpt에서는 클라이언트 사이드에서 실행되어야 하는 코드가 서버 사이드에서 실행되서 그렇다고 하는데 잘해결이 안되고 있습니다. npm run dev시에는 에러없이 잘 실행됩니다. "use client"; import React, { ChangeEventHandler, useState } from "react"; import LexicalEditor from "@/app/newpost/LexicalEditor"; function Page({ props }: any) { const [title, setTitle] = useState(""); const [content, setContent] = useState(""); const onChangeTitle: ChangeEventHandler<HTMLInputElement> = (e) => { setTitle(e.target.value); }; const onSubmit = (e: any) => { e.preventDefault(); console.log("제목 : ", title); console.log("내용 : ", content); }; return ( <form className="postForm" onSubmit={onSubmit}> <div className="postForm__titleInputSection"> <input className="postForm__titleInput" type="text" name="title" value={title} onChange={onChangeTitle} placeholder={"제목을 입력하세요."} /> </div> <div className="postForm__editorWrapper"> <LexicalEditor /> </div> <button>작성하기</button> </form> ); } export default Page; 깃허브 링크 입니다. https://github.com/littleduck1219/codeblog/blob/main/src/app/newpost/page.tsx

  • react
  • next.js
  • react-query
  • next-auth
  • msw
Gyeongdeok PARK 댓글 2 좋아요 0 조회수 2048

nginx 후 Front(502 Bad Gateway), back(welcome to nginx) 라고만 나오는 문제

미해결

[리뉴얼] React로 NodeBird SNS 만들기

안녕하세요 선생님 front, back nginx 한 뒤로 둘다 https라고 바뀌고 인증서도 있긴한데, Front(502 Bad Gateway)라고 나오고 back(welcome to nginx) 라고만 나오는 상태입니다. (설치는 Nginx Ubuntu20보고 했습니다 https://certbot.eff.org/instructions?ws=nginx&os=ubuntufocal&tab=standard ) 문제1)그래서 첫번째 문제로 back에서 sudo npx pm2 logs --err --lines 200를 해보았을 땐 아래와 같은 경고가 나왔습니다. 0|app | Warning: connect.session() MemoryStore is not 0|app | designed for a production environment, as it will leak 0|app | memory, and will not scale past a single process. 질문1)찾아보니까 express-session 미들웨어의 기본 메모리 저장소( MemoryStore )를 사용할 때 MemoryStore 가 개발 환경에서는 적합하지만, 실제 프로덕션 환경에서는 메모리 누수 문제와 단일 프로세스 제한으로 인해 적합하지 않아 프로덕션 환경에서는 Redis, MongoDB 등의 세션 저장소를 사용하라는데, 그럼 front 화면이 나오는건지 궁금합니다,, 문제2)그리고 두번째 문제로 back에서 tail /var/log/nginx/error.log를 했을 땐 아래와 같은 에러가 나왔습니다. ubuntu@ip-172-31-12-59:~/react_nodebird/back$ tail /var/log/nginx/error.log 2024/01/24 12:19:54 [warn] 420260#420260: conflicting server name "api.luckyhaejin.com" on 0.0.0.0:80, ignored 2024/01/24 12:19:54 [notice] 420260#420260: signal process started 질문2)찾아보니 Nginx 설정 파일 내에 서 api.luckyhaejin.com 이라는 서버 이름(server name)이 80 포트에서 두 번 이상 선언되었음을 나타내는 에러라는데 어떤 부분이 잘못되었는지 잘 모르겠어서 어딜 확인하면 좋을지 문의 드립니다. 질문3)강의에서 Ubuntu서버만 바꿔주고 로컬은 바뀌는 부분 이없는거같아서 Ubuntu서버에서만 바꿔줬는데, 그럼 로컬에도 Ubuntu에 설치한 것 다 포함해서 코드까지 다 바꿔준 뒤 Ubuntu에서 git pull 다시 해줘야할까요,,? 현재 설정된 내용) front=> /etc/nginx/nginx.conf => server관련 (글을 옮겨적으니까 들여쓰기 해서 정리 한게 코드가 전부 합쳐져서 사진으로 올립니닷,,) front/pacakage.json에서 start부분에 3060 잘 되어있음 front => /etc/nginx/nginx.conf front/config/config.js에서 backUrl설정 잘 되어있음 back => /etc/nginx/nginx.conf back => app.js(사진이 보기 편하실거같아서 코드랑 둘다올려욧) const express = require('express'); const cors = require('cors'); const session = require('express-session'); const cookieParser = require('cookie-parser'); const passport = require('passport'); const dotenv = require('dotenv'); const morgan = require('morgan'); const postRouter = require('./routes/post'); const postsRouter = require('./routes/posts'); const userRouter = require('./routes/user'); const hashtagRouter = require('./routes/hashtag'); const db = require('./models'); const passportConfig = require('./passport'); const path = require('path'); const hpp = require('hpp'); const helmet = require('helmet'); dotenv.config(); const app = express(); db.sequelize.sync() .then(() => { console.log('DB 연결 성공'); }).catch(console.error); passportConfig(); if(process.env.NODE_ENV === 'production'){ app.use(morgan('combined')); app.use(hpp()); app.use(helmet()); app.use(cors({ origin: 'https://luckyhaejin.com', credentials: true })); } else { app.use(morgan('dev')); } app.use('/', express.static(path.join(__dirname, 'uploads'))); app.use(express.json()); app.use(express.urlencoded({extended:true})); app.use(cookieParser(process.env.COOKIE_SECRET)); app.use(session({ saveUninitialized: false, resave: false, secret: process.env.COOKIE_SECRET, cookie: { httpOnly: true, //자바스크립트로 접근하지못하게 secure: true, //일단 false로 하고 https적용할 땐 ture domain: process.env.NODE_ENV = 'production' && '.luckyhaejin.com' //도메인 사용할 경우 }, })); app.use(passport.initialize()); app.use(passport.session()); app.get('/', (req, res) =>{ res.send('hello express'); }); app.use('/posts', postsRouter); app.use('/post', postRouter); app.use('/user', userRouter); app.use('/hashtag', hashtagRouter); app.listen(3065, () => { console.log('서버 실행 중'); }); back => /etc/nginx/nginx.conf 사용중인 Os) macOS

  • react
  • redux
  • node.js
  • express
  • next.js
댓글 2 좋아요 0 조회수 1120

인기 태그

인프런 TOP Writers

주간 인기글