분류 전체보기
-
[CS study] 로컬스토리지 && 세션스토리지네트워크/CS Study 2023. 7. 13. 19:54
로컬스토리지와 세션스토리지의 개념 1. 로컬스토리지와 세션스토리지의 공통점 데이터를 클라이언트에 저장 할 수 있다 JS API의 형태가 완전히 동일하다 (하나의 사용법만 익혀도 둘 다 사용이 가능하다) 2. 로컬스토리지와 세션스토리지의 차이점 로컬스토리지는 웹페이지를 종료하더라도 데이터가 날아가지 않는다 반면 세션스토리지는 세션이 종료하게 되면 데이터가 사라진다 (창을 닫았을 때 세션이 종료됨으로 보자) 로컬스토리지는 데이터를 모든 세션이 공유하는 반면 세션스토리지는 각 세션마다 데이터를 저장하고 공유하지 않는다 3. 로그인페이지를 만들 때 사용가능하겠다 - 로컬스토리지와 세션스토리지는 서버에 들어가지 않아도 되는 중요하지 않은 데이터를 저장하는데 사용이 되는데 클라이언트에 직접 저장이 되기 때문에 이러..
-
[Inflean 장기효] 입문강의 -문법-프로그래밍 언어/TypeScript 2023. 7. 13. 15:30
변수타입 // JS 문자열 선언 const str = "hello"l // TS 문자열 선언 let str:string = "hello"; let num : number = 10; // TS 배열 선언 let arr : Array = [1, 2, 3]; // arr라는 배열은 안에 number만 들어올 수 있는 Array이다 let items : number[] = [1, 2, 3]; let animal : Array = ["cat", "dog"] // 배열 안에 숫자를 넣으면 빨간줄이 생긴다 // TS 튜플 선언 let address : [string, number] = ["gangnam", 123]; //배열의 각각 index에 타입을 정의 할 수 있다 // TS 객체 선언 let obj: objec..
-
[Inflean 장기효] 입문강의 -문법 이전 내용-프로그래밍 언어/TypeScript 2023. 7. 13. 14:53
교안 : 타입스크립트 핸드북 (joshua1988.github.io/ts/) 타입스크립트란? 자바스크립트에 타입을 부여한 언어이다 자바스크립트와는 다르게 브라우저에서 실행하기 위해 파일을 한번 변환해주는 과정(컴파일)이 필요하다 타입스크립트는 왜 써야하는가? JS를 써서 비동기 처리를 할 때 [object Object] 이런 데이터들을 몇번 보았는데 이러한 부분을 타입스크립트를 쓴다면 좀 더 명확하게 연결 할 수 있다. 또한 오탈자로 인해서 정보를 불러오지 못하는 경우(undefined) 에러로 연결 될 수 있다 이런 부분도 타입스크립트를 통해 보완 할 수 있다. 코드 상으로 알 수 없는 데이터의 모습을 파악 할 수 있다. (에러의 사전 방지) 브라우저를 실행해서 data 값을 보고 그것을 기반으로해서 ..
-
[항해 99 주특기] 토큰 && JWT개발일지/항해 99 2023. 7. 12. 23:55
토큰 Tocken이란 클라이언트에서 보관하는 암호화된 인증 정보로써 서버에서 발급 보관하는 정보인 session과의 가장 큰 차이점은 보관하는 방식이다. 이러한 토큰은 세션처럼 서버에서 보관할 필요가 없어서 서버의 부담을 줄여주고 최근에 가장 많이 사용되는 기술이다 이러한 토큰 중 하나인 JWT(Json Web Tocken) 는 헤더와 페이로드, 시그니쳐로 구성 되어있으며 JWT 공식 문서를 가서 확인하면 인코딩 된 상태와 디코딩 된 상태를 볼 수 있다 (왼쪽 인코딩코드 오른쪽 디코딩코드) 서버에서 발급받은 jwt에는 시크릿코드가 있는데 이 시크릿코드는 보안을 강화해서 보관해야한다 왜냐하면 시크릿코드를 이용해서 서버에서 jwt를 브라우저에게 발급 해주고 그걸 브라우저가 관리하기 때문이며 이 시크릿코드를 ..