본문 바로가기

project/insightLINK

(5)
[나만무] node Logging System [나만무] node Logging System 개복치 서버 문제를 해결하기 위해 Logging 시스템 도입.. 라이브러리 설치 $ npm install winston $ npm install winston-daily-rotate-file $ npm install app-root-path server/winston/logger.js import winston from 'winston'; import winstonDaily from 'winston-daily-rotate-file'; const logDir = 'logs'; // logs 디렉토리 하위에 로그 파일 저장 const { combine, timestamp, printf } = winston.format; // Define log format co..
[나만무] Next Auth, google social login 구현 [나만무] Next Auth, google social login 구현 기존 구현했던 react-google-login 라이브러리 이용한 google login은 캐시를 지워줘야 됐다. 됐다 안됐다..하는 기능은 사실상 안되는 기능이다! npm i uninstall react-google-login 그래서 여러 자료를 찾던 중 NextAuth가 있길래 바로 이용. 참고 자료 https://www.youtube.com/watch?v=6lCXM11Tgyg https://dantechblog.gatsbyjs.io/posts/next-auth/ Home | Dan DevLog Blog posted about development dantechblog.gatsbyjs.io pages/api/auth/[...nex..
[나만무] 검색 기능 [나만무] 검색 기능 Front 쿼리 전달 features/Dashboard/components/SearchBar.tsx import React, { useState, KeyboardEvent } from "react"; import { useRouter } from "next/router"; export default function SearchBar() { ... const [keywords, setKeywords] = useState(""); const onKeyPress = (e: KeyboardEvent) => { if (e.key == "Enter") { e.preventDefault(); router.push({ pathname: '/search', query: {search : keywor..
[나만무] Google Social 로그인 [나만무] Google Social 로그인 구글 드라이브를 연동해야 할 수 도 있어서 google oauth 선택! 시간적 여유가 된다면, 카카오 소셜 로그인도 추가할 듯하다. 일단, 구글만! 회원가입은 없고, 소셜로 로그인하면 얻을 수 있는 정보로 회원관리할 예정이다, 로그인 한 회원이 유저 테이블 정보에 있으면 바로 토근 발급. 그렇지 않으면, 유저테이블에 등록후, 토근 발급!! 우리 서비스 서버에서 발행한 토큰으로 세션관리할 예정이다. 그렇다면 구글 oauth access token은 어디다 쓸꺼냐? 구글 드라이브 접근할 때, 사용할 듯하다... 더 알아봐야 한다. 일단 우리 서비스 세션 관리가 우선! Oauth 란? 사용자는 서비스 별로 로그인 정보를 따로 관리해야 해 불편함 검증되지 않은 App..
[나만무] 로그인 - 로그아웃 [나만무] 로그인 - 로그아웃 React-Node-MySQL 연동 프로젝트 진행 순서 1. CRA 생성 2. server 폴더 생성 - db 연결, 서버 3. Proxy설정 - package.json 폴더 구조 Client Server 리액트를 익히면서 클라이언트 서버가 있다는 걸 처음 알았다. 3000번 포트로 이어져 있기 때문에 이걸 proxy를 통해 포트 전환 해줘야 한다. 터미널창을 분리해서 두개의 서버를 돌려야 한다. 폴더 진입 주의!! Run Client Run Server .env DANGEROUSLY_DISABLE_HOST_CHECK=true PORT = 8000 MYSQL_HOST = 127.0.0.1 MYSQL_USERNAME = root MYSQL_PASSWORD = [비번] MYSQ..