본문 바로가기

분류 전체보기

(291)
코딩 테스트 연습 14일 코딩 테스트 연습 14일 프로그래머스, 캐릭터의 좌표 📄 나의 코드 board = [7, 9] keyinput = ["down", "down", "down", "down", "down"] def solution(keyinput, board): cur = [0,0] for key in keyinput: if key == "left" and cur[0] > -(board[0] // 2): cur[0] -= 1 elif key == "right" and cur[0] -(board[1] // 2)..
Node.js 입문 주차 1주차_5 Node.js 입문 주차 1주차_5 git 형상관리 도구 📌 SSH Key 발급 ssh-keygen -t rsa -b 4096 -C "archepro84@gmail.com" 📌 키 파일 open cat ~/.ssh/id_rsa.pub 📌 git init git init 📌 .gitignore 파일 생성 git add . git commit -m "first Commit All Files" git push -u origin master 📌 원격 repo 업로드 확인 수정된 사항 업로드 📌 변경사항 있는지 확인 git status git add . git commit -m "Second Commit Files" git push aws 인스턴스 cd Download ssh -i ./sparta_keypair...
Node.js 입문 주차 1주차_4 Node.js 입문 주차 1주차_4 MongoDB, Studio 3T 설치 📌 mongoose DB Clinet 역할 npm install mongoose MongoDB 연결 📄 app.js const express = require('express'); const app = express(); const port = 3000; const goodsRouter = require('./routes/goods.js'); const connect = require('./schemas/index.js'); connect(); app.use(express.json()); app.use("/api", goodsRouter); app.listen(port, () => { console.log(port, '포트로 서버..
내일배움캠프 4기_JS기초&알고리즘 22일차 TIL 내일배움캠프 4기_JS기초&알고리즘 22일차 TIL https://pangeei-h.tistory.com/entry/Nodejs-%EC%9E%85%EB%AC%B8-%EC%A3%BC%EC%B0%A8-1%EC%A3%BC%EC%B0%A82 Node.js 입문 주차 1주차_2 Node.js 입문 주차 1주차_2 객체 리터럴이란? 객체를 생성하기 위한 표기 방법 📌 사칙연산하는 객체 const calculater = { add : function (a, b) {return a+b}, sub : function (a, b) {return a-b}, mul : function (a, b) {return a* pangeei-h.tistory.com https://pangeei-h.tistory.com/entry/Nod..
코딩 테스트 연습 12일, 13일 코딩 테스트 연습 12일, 13일 프로그래머스, n의 배수 고르기 📄 내 코드 n = 12 numlist = [2, 100, 120, 600, 12, 12] def solution(n, numlist): answer = [] for num in numlist: if num % n == 0: answer.append(num) return answer print(solution(n, numlist)) list.remove 사용해야하는 줄 알았는데. 아니었다. 주어진 값을 변경하지 않는게 좋은 것 같다. 📌 공부할만한 코드 def solution(n, numlist): answer = [i for i in numlist if i%n==0] return answer 프로그래머스, 2차원으로 만들기 📄 내 코드 ..
Node.js 입문 주차 1주차_3 Node.js 입문 주차 1주차_3 Express.js란? Node.js로 서버를 빠르고 간편하게 만들 수 있게 도와주는 웹 프레임워크 npm install -y npm install express 📄 app.js const express = require('express'); const app = express(); const port = 3000; app.get('/', (req, res) => { res.send('Hello World!'); }); app.listen(port, () => { console.log(port, '포트로 서버가 열렸어요!'); }); GET test router 클라이언트 요청을 쉽게 처리할 수 있는 기능 중 하나. 📄routes/goods.js const expres..
Node.js 입문 주차 1주차_2 Node.js 입문 주차 1주차_2 객체 리터럴이란? 객체를 생성하기 위한 표기 방법 📌 사칙연산하는 객체 const calculater = { add : function (a, b) {return a+b}, sub : function (a, b) {return a-b}, mul : function (a, b) {return a*b}, div : function (a, b) {return a/b} } console.log(calculater.add(3,2)); console.log(calculater.sub(3,2)); console.log(calculater.mul(3,2)); console.log(calculater.div(3,2)); Error handling 에러를 관리하는 방법, 예상치 못한 상..
내일배움캠프 4기_JS기초 21일차 TIL 내일배움캠프 4기_JS기초 21일차 TIL https://pangeei-h.tistory.com/entry/Nodejs-%EC%8B%A4%EB%AC%B4-%EA%B8%B0%EC%B4%88-1%EC%A3%BC%EC%B0%A8 Node.js 실무 기초 1주차 Node.js 실무 기초 1주차 편집기 : VS Code, cmd Node.js란? 자바스크립트가 실행될 수 있게 도와주는 런타임 플랫폼 V8 엔진으로 빌드된 자바스크립트 런타임 플랫폼(마법 상자) 한국어 : 자바스크립트 pangeei-h.tistory.com https://pangeei-h.tistory.com/entry/Nodejs-%EC%9E%85%EB%AC%B8-%EC%A3%BC%EC%B0%A8-1%EC%A3%BC%EC%B0%A8 Node.js ..
Node.js 입문 주차 1주차 Node.js 입문 주차 1주차 Node.js 특징 Async + Non-blocking Model Non-blocking : 함수가 실행되는 중에도 다른 작업을 동시에 진행할 수 있음. Single Thread : 동시에 하나의 작업만 수행할 수 있음 Event Loop : 싱글 스레드 약점을 극복하기 위해 효율적으로 작업을 처리할 수 있는 특성 ※ java랑 c언어는 blocking, 비동기 처리가 가능한 환경이어도 비동기 처리가 불가능하다. promise test async function main() { function first(){ console.log("Set Time Out이 실행되었습니다."); } console.log("코드가 실행되었습니다."); setTimeout(first, 100..
Node.js 실무 기초 1주차 Node.js 실무 기초 1주차 편집기 : VS Code, cmd Node.js란? 자바스크립트가 실행될 수 있게 도와주는 런타임 플랫폼 V8 엔진으로 빌드된 자바스크립트 런타임 플랫폼(마법 상자) 한국어 : 자바스크립트 한국말 : node.js(소리라는 수단으로 나의 의견 & 생각을 전달할 수 있다. 실행시키는 수단) 📌 npm이란? 자바스크립트를 사용할 수 있는 패키지(모듈) 관리자 ex) pip와 동일한 역할을 함. npm install express https://www.npmjs.com/ npm Bring the best of open source to you, your team, and your company Relied upon by more than 11 million developers ..