전체 글
-
항해 99 5기 TIL_24항해 99 2022. 2. 3. 04:26
▶ Today I Learned [require와 IIFE] [require의 동작 원리] require는 module.js라는 파일 내 정의된 메서드로써 ()내 지정된 경로의 파일을 불러온다. 그 다음 해당 파일의 코드를 IIFE(즉시 실행 함수표현식)화 하고, 코드 내 값을 module.exports라는 object를 통해 return해주게 된다. 이때 파일 내 정의된 코드를 IIFE화 함으로써 해당 코드가 다른 모듈이나 코드에 간섭을 받지 않으며 동시에 require에 라는 함수로 접근은 가능하게 해주는 것이다. 좀 더 상세한 설명은 아래에 적혀있다. [npm require 함수] require는 외부의 모듈을 끌어오기 위한 함수이며 require()에서 ()안에 추가할 모듈의 파일 경로 값을 받는..
-
항해 99 5기 TIL_23항해 99 2022. 2. 2. 00:50
▶ Today I Learned 함수: 프로시저, 서브루틴과 동일한 의미라 볼 수 있음. 똑같은 코드를 두 번 이상 작성하는 것을 피하고자 나온 수단. 함수가 호출되는 것을 영어로 call이나 invoke 한다고 표현한다. 스택: 물건을 쌓듯 데이터를 쌓아 올리는 구조, 나중에 들어온 것이 먼저 나간다(last in, first out)이라고 해서 LIFO 구조라고도 한다. 함수 호출 시 많이 사용되며 값을 저장할 때는 push, 값을 빼낼 때는 pop을 실행한다. 스택이 쌓이다 들어갈 공간이 없는 경우가 스택오버플로우, 빈 스택에서 물건을 가져오려는 경우가 스택언더플로우 가 된다. [JWT] JWT: Json Web Token Json 형태의 데이터를 안전하게 교환하여 사용할 수 있도록 해줌 표준으로 ..
-
항해 99 5기 TIL_22항해 99 2022. 2. 1. 01:01
▶ Today I Learned [컴퓨터의 구조] 가장 흔한 구조: 폰 노이만 구조, 하버드 구조 https://velog.io/@ckstn0777/%EC%BB%B4%ED%93%A8%ED%84%B0-%EA%B5%AC%EC%A1%B0 cf) 컴퓨터 상에서 버스(bus)란? - 데이터를 통신할 수 있게 해주는 시스템 https://richong.tistory.com/92 1) 메모리 조작할 비트들의 저장소, 메모리의 기본단위는 1바이트(= 8비트) 2) I/O Input/Output의 약자, 컴퓨터 및 주변장치에 대하여 데이터를 전송하는 프로그램, 운영 혹은 장치를 일컫는 말. 대개의 경우 입력에 함께 출력이 발생하게 되지만 키보드와 마우스처럼 입력을 위한 기기, 프린터처럼 출력에만 사용되는 기기도 있다. ..
-
항해 99 5기 WIL_3항해 99 2022. 1. 30. 19:16
▶ Weekly I Learned (회고) 이번 주도 정신없이 지나갔다. 현재는 홈페이지 구현의 첫주차 과제를 성공적으로 끝 마치고 두번째 주차에 접어들어있다. 기존 기능에 로그인이나 댓글같은 기능을 더해 홈페이지를 업그레이드하는 과정이다. 쉽지 않아 시간이 꽤 소요될 것 같지만 다양한 기술스택을 사용해보는 것과 코드 복기를 위해 기존 코드를 ajax대신 axios를 이용해 다시 짜고 있다. 특징에 대해서도 조사해보았는데 현재까지 써본바로는 좀 더 직관적이고 사용이 간편하다는 특징이 있다. 앞으로도 사용해보고 다음에는 fetch()를 써보는 방식으로 기술 스택들에 대해 좀 더 알아보아야 겠다. 또한 얼른 마무리 짓고 다음 단계로 넘어가보아야 겠다. 매일 같이 문제를 해결해내고 고민하며 조금씩 성장해가는 ..
-
항해 99 5기 TIL_21항해 99 2022. 1. 30. 16:56
▶ Today I Learned [404 Error] : 클라이언트가 서버와 통신은 가능하지만 클라이언트가 요청한 것을 서버가 찾을 수 없다는 것을 가리키는 HTTP 표준 응답 코드, 대상 서버로 연결할 수 없다는 뜻은 아니니 혼동하지 않도록 주의하자. [스키마 모델의 연결] 현재 DB에 있는 데이터를 불러와 index.html에 보내줘서 게시글 정보를 띄우려 작업 중이다. 먼저 데이터가 정상적으로 전송되는지 시도해보았으나 connection Error가 발생했다. 콘솔을 구간별로 찍은 결과 다음의 코드에서 get 요청이 router에 닿지 않았고 이로 인해 연결에러가 뜬 것 같다. index.html 코드 $(document).ready(function () { console.log("홈페이지 시작")..
-
항해 99 5기 TIL_20항해 99 2022. 1. 30. 01:38
▶ Today I Learned 그동안 동기와 비동기라는 개념을 반대로 이해하고 있었다.. 동기가 동시에 여러가지가 일어나는 것이라 생각했는데 다시보니 한 작업의 결과가 나올 때까지 대기하는 것이 동기이며 결과가 나올 때까지 다른 일을 해주는 것이 비동기였다. 그럼 ajax는 response가 올 때까지 기다려야하니까 비동기인 것이라고 할 수도 있다. 하지만 ajax는 동기이다. 필요한 데이터를 받아올 때 페이지 전체를 업로드하고서 그다음 받아오는 것이 아닌 ajax로 요청해서 딱 그 부분만 받아올 수 있기 때문이다. 상세한 설명은 아래 링크를 참조했다. https://private.tistory.com/24 https://sjparkk-dev1og.tistory.com/27 [node app.js 미실..
-
항해 99 5기 TIL_19항해 99 2022. 1. 29. 01:17
▶ Today I Learned S-R latch같은 것이 나왔는데 사실 이해할 수 없었다.. 내용이 너무나 어려웠다..이건 추후 '유튜브 뽕교수의 전자공학' 강의를 들어보자..! [PM2] Node.js 어플리케이션을 쉽게 관리할 수 있도록 해주는 Process Manager. 이것을 사용하면 터미널 창을 끄거나 node를 종료하더라도 서버가 꺼지지 않게 할 수 있다. 즉, 서버에 연결된 웹사이트에 계속 접속이 되는 것이다. 깊이 들어가면 더욱 자세한 내용들이 나오지만 우선은 구현이 주 목적임을 잊지 말자. 필요할 때에 좀 더 깊이 배우면 된다 :) [npm을 이용해 터미에 mongoose를 설치하는 명령어] npm i mongoose -S 여기서 -S는 무엇을 의미할까? 구글링하여 방법을 알아냈고 터..
-
항해 99 5기 TIL_18항해 99 2022. 1. 28. 00:52
▶ Today I Learned hysteresis(이력 현상) :어떤 물리량이 그때의 물리 조건만으로는 일의적으로 결정되지 않고, 그 이전에 그 물질이 경과해온 상태의 변화 과정에 의존하는 현상 ex) 취업을 못하던 사람이 취업을 계속 못함 웹 클라이언트: 요청하는 쪽, 사용자 측 웹 서버: 요청받아서 처리해주는 쪽 [서버 배포] IP 주소 : 각 기기에 존재하는 좌표 같은 개념, 특수한 주소, 네트워크 연결 시 IP 할당받음 공인 IP 갯수가 너무 많아 갯수를 관리하기 위해 사설 IP 도입 ex) 공유기에 공인 IP를 주고 연결, 그 공유기(라우터, 인터넷과의 통로역할 하는 이런 것을 NAT 라고 함)를 이용하는 기기들에는 공유기에서 주는 사설 IP 발행, NAT 덕분에 사설 IP를 써도 공인 IP와..