본문 바로가기

전체 글

(69)
200115(수) Devlog. sequelize DataType, jwt 토큰만료 error 처리 1. Sequelize Data type https://sequelize.org/master/manual/model-basics.html#data-types sequelize에는 여러 옵션이 있는데, 그 중 data type옵션을 알아보았다. 테이블에 flag설정을 위해 boolean형식의 data type을 찾는 중, 하는 김에 다 가져와봤다(Others에 딸린 링크에 더 있긴 하지만). Strings DataTypes.STRING // VARCHAR(255) DataTypes.STRING(1234) // VARCHAR(1234) DataTypes.STRING.BINARY // VARCHAR BINARY DataTypes.TEXT // TEXT DataTypes.TEXT('tiny') // TINYTE..
200114(화) Devlog. Express request, mysql 사용자 추가 1. Express request https://expressjs.com/ko/api.html#req 서버 라우팅 하려는데 필요해서 찾아봤다. req.originalUrl req.url is not a native Express property, it is inherited from Node’s http module. This property is much like req.url; however, it retains the original request URL, allowing you to rewrite req.url freely for internal routing purposes. For example, the “mounting” feature of app.use() will rewrite req.u..
200108(수) TIL AWS S3사용, EC2, RDS AWS(Amazon Web Service) 1. Amazon S3(Simple Storage Service) AWS에서 제공하는 인터넷용 스토리지 서비스. 클라이언트 배포에 많이 쓰인다. redux 연습하면서 만들어뒀던 간단한 counter app으로 S3 버킷을 만들것이다. 아래는 해당 app의 파일 구조. 1-1. react app을 build $ npm run build 혹은 $ yarn build build를 하면 아래와 같이 원래 없던 build디렉토리가 생긴다. 일단 build해 놓고 C3버킷을 만들러 감 1-2. 버킷 생성 https://s3.console.aws.amazon.com/ 버킷 만들기 버튼 클릭 버킷 이름과 지역 선택 후 생성 버튼 클릭 1-3. 버킷 설정 변경 방금 만든 버킷 ..
200105(일) TIL Shortly Sprint 구조 Shortly Sprint 구조 1. server/ 실선은 디렉토리 구조, 점선은 화살표 시작점이 끝나는 파일을 require해서 사용하는 관계를 나타냄! 2. DB 2-1. urls table Column Name Type id integer primary key, not null, auto increment url string baseUrl string code string title string visits integer not null, default: 0 createdAt date not null updatedAt date not null 2-2. user table Column Name Type id integer primary key, not null, auto increment email ..
200103(금) TIL. Authentication and Full Stack Development Sprint Review 2주 프로젝트: join써보기 행동 기반 testcase bdd(behavior driven development) teardown, setup Authentication and Full Stack Development 인증, 로그인 관련 이슈 보안 클라이언트, DB, server를 다 만들어 보기. 1. Hashing 1-1. No Authentication 보안상 issue가 발생! 1-2. Authentication(Plaintext) email: 공개된 data password: 유저만 알고 있어야 함 -> DB에 암호화해서 저장해야 함. 1-3. Encryption 암호화는 일련의 정보를 임의의 방식을 사용하여 다른 형태로 변환하여 해당 방식에 대한 정보를 소유한 사람을..
191229(일) TIL. DB SQL-2 SQL-2 1. Joins 두 개 이상의 테이블에서 칼럼을 중심으로 테이블의 행을 결합함. (INNER) JOIN: 겹치는 값만 return함 LEFT (OUTER) JOIN: 모든 왼쪽 table의 값, 겹치는 값을 return RIGHT (OUTER) JOIN: 모든 오른쪽 table의 값, 겹치는 값을 return FULL (OUTER) JOIN: 모든 값 return 다음의 사이트에서 SQL명령어를 입력하면 직접 해 볼 수 있다: https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all SELECT * FROM orders; SELECT * FROM customers; SELECT orders.orderID, customers.cus..
191227(금) TIL. DB SQL-1 DB를 사용하는 이유 In-memory 끄면 데이터가 없어짐 File I/O 원하는 데이터만 가져올 수 없고 항상 모든 데이터를 가져온 뒤 서버에서 필터링 필요 DB 데이터 관리, 필터링 등 데이터에 특화된 여러 기능들을 가지고 있는 서버 https://www.w3schools.com/sql/default.asp 1. SQL Intro 1-1. SQL SQL (Structured Query Language): 구조화된 Query 언어 DB에 접속하고 처리할 수 있게 해줌 데이터베이스용 프로그래밍 언어 DB에 query를 보내 원하는 데이터만을 가져올 수 있음. Query: (질의문)저장되어있는 정보를 필터하기 위한 질문 1-2. RDBMS RDBMS (Relational Database Managemen..
191223(월) TIL. Promise 1. Async 비동기는 제어하기 힘들다. const printString = (string) => { setTimeout( () => { console.log(string) }, Math.floor(Math.random() * 100) + 1 ) } const printAll = () => { printString("A") printString("B") printString("C") } printAll() //"A", "B", "C"가 뒤죽박죽 출력됨 2. Callback callback을 통해서 비동기 실행을 제어할 수 있음. const printString = (string, callback) => { setTimeout( () => { console.log(string) callback() }, ..