본문 바로가기

분류 전체보기

(68)
Open Weather API - Postman - JSON https://openweathermap.org Current weather data - OpenWeatherMap Access current weather data for any location on Earth including over 200,000 cities! We collect and process weather data from different sources such as global and local weather models, satellites, radars and a vast network of weather stations. Data is avai openweathermap.org https://www.postman.com/ Postman API Platform | Sign Up f..
APIs : Endpoint, Paths, Parameters, and Autentication. An Application Programming Interface is a set of commands, functions, protocols, and objects that programmers can use to create software or interact with an external system. 다른 개발자가 만들어놓은 프로그램을 외부의 다른 개발자가 갖다가 쓰는거. 데이타 제공자와 개발자간의 계약. 예를 들어, 지역별 범죄율 데이터, 날씨, 공공 데이터, jquery 등등 Your server request-----> API ----->request someone else's server
Calculator 만들기: 2+3은 23의 문제에 대하여.. calculator.js // jshint esversion:6 const express = require("express"); const bodyParser = require("body-parser"); const app = express(); app.use(bodyParser.urlencoded({extended:true})); app.get("/", function(req, res) { res.sendFile(__dirname + "/index.html"); }); app.post("/", function(req, res) { var num1 = req.body.num1; var num2 = req.body.num2; var result = num1 + num2; res.send ("The resu..
Calculator 만들기: res.sendFile(__dirname calculator.js 더보기 const express = require("express"); const app = express(); app.get("/", function(req, res) { res.sendFile (__dirname + "/index.html"); ); }); app.listen(3000, function() { console.log ("Server started on port 3000"); }); index.html 더보기 Calculator 1. res.sendFile res.send("Hello World")는 입력값(Hello World)을 출력했고 sendFile은 괄호내의 주소의 파일(index.html) 을 출력한다. 2. __dirname 로칼 내부에서 주소는 이때..
Understanding with Routes. //jshint exversion:6 const express = require("express"); const app = express(); app.get("/", function(req, res){ res.send("Hello, World!"); }); "/"가 우리의 route입니다. 나중에 커지면 google.com과 같은 이름을 얻을 수 있다. app.get("/contact", function(req, res) { res.send("Contact me at hailey@gmail.com") }) app.get ("/about", function(req, res){ res.send ("I am Covid-virus positive. And I can finally have some rest at..
챌린지) npm 이용하여 superhero 이름 생성하기 1. npm에서 superhero names 를 검색 2. 제일 위에 나와있는 superheroes" 발견 3. 터미널로 돌아와서 npm init 엔터 4. npm install superheroes (오타없이) 엔터 5. start code index.js 6. //jshint esversion:6 const superheroes = require("superheroes"); const mySuperheroName = superheroes.random(); console.log(mySuperheroName); 7. 터미널로 돌아와서 node index.js 엔터, 수퍼히로 이름이 생성된다 피드백) 1. npm install superheroes를 해야 했는데, node install을 쳐서 에러 2. ..
starting Node and exit the node mode starting Node 명령어: node 엔터 $로 시작되던 라인이 >로 바뀌면 코딩 시작 가능 index.js 파일을 노드로 터미널에 불러오기 명령어: node index.js 엔터 exit 명령어: .exit 또는 ctrl+c 두번 하면 node 모드 해제
터미널 코맨드라인 명령어 (window 기준, 기본) cd: change directory cd Doc 다음 Tab 키 누르면 알아서 Documents 또는 Doc로 시작하는 폴더이름 찾아줌 pwd: 현재 지정된 위치 확인 ls: 지정 폴더 안에 있는 파일 list 보여줌 (그래픽 유저 인터페이스 파일이 보여주지 않는 비밀 파일까지도 보여줌) cd .. : 현재 위치의 윗 폴더로 ctrl + A : 코맨드 라인의 시작부분으로 커서 위치 변경 ctrl + E : 코맨드 라인의 끝부분으로 커서 위치 변경 ctrl + u : 코맨드 라인 삭제 rm : remove mkdir 새폴더이름: 지정된 폴더에 새폴더 생성 (예, mkdir Birdfolder) touch 새파일이름: 지정된 폴더에 새파일 생성 (예, touch Text2.txt Text3.txt) sta..