โ๏ธ To update the clone that the user received, these commands are needed:
*git pull origin master: Update the file "master".
*git stash: Transient(temporal) savings are done but not commited to git yet.
*git stash list: See the list of temporary saved files.
*git stash pop: Get the part of the files that user saved temporaly.
The code that starts with on goes to events; Meaning that information of the tags go to events when there happens some changes in input.
--> ex) onChange, onClick, etc.
Empty string means false.
If there are any strings included in the braket, it is considered as true even it is written " ". The space takes the string of space itself.
--> The goal is for the computer to recognize the message/string.
Also, 0 equals false and all real numbners except 0 equals true.
FTP: Sending regualr files.
SMTP: Sending simple mails.
HTTP: Sending text or typer-text. (The one that I'm going to use often.)
โ๏ธ Each APIs have different functions thus the user must request to the corresponding API for the response.
โ๏ธ Form of a link.
โ๏ธ Form of a function.
Header insdie the response that contains the short summary of what kind of data it contains.
๐ก JSON: Java Script Object Notation
Executing the response as a form of object(๊ฐ์ฒด).
--> Interact in a form of JSON.(Also receive status response code.)
--> Request** in form of object, which contains keys and values.
Create Read Update Delete
โ๏ธ These four things should better be included in API.
โ๏ธ Backend needs them for making API so that it can respond to what frontend requested.
Each of them are operated by specific options:
-- Axios --
Post: Add data
Put: Edit data
Delete: Remove data
Get: Get data from the server
-- Apollo-client --
Mutation: Functions that affct data
Query: Functions that don't affect data
โ๏ธ Both get and query don't give any changes to data. Just getting or checking the data.
โก๏ธ To use these functions in vs code:
โฆ๏ธ Axios : import axios from 'axios'
const result = axios.post(API NAME GOES HERE)
const result = axios.put(API NAME GOES HERE)
const result = axios.delete(API NAME GOES HERE)
const result = axios.get(API NAME GOES HERE)
โฆ๏ธ Apollo-client : import {useMutation, useQuery} from '@apollo/client'
const result = useMutation(API NAME GOES HERE)
๐ To sum up, Rest-API uses axios that receives all data given by backend while graphql uses apollo-client that picks specific needed data.
๐น Rest API => Postman & Swagger
-->Swagger contains API docs.
--> Postman downloaded in Google apps.
๐ฐ Excercise Link:
http://example.codebootcamp.co.kr/api-docs
http://koreanjson.com
โฌ๏ธ How Swagger looks like: โฌ๏ธ
โฌ๏ธ How Postman looks like: โฌ๏ธ
๐น Graphql API => Playground
๐ฐ Excercise Link:
http://example.codebootcamp.co.kr/graphql
โฌ๏ธ createBoard โฌ๏ธ
โฌ๏ธfetchBoardโฌ๏ธ
โ๏ธ If-condition executes the logic only if the condition matches.
๐ If - Boolean
function boolean(input1, input2){
if (input1 === true || input2 === true) {
//์กฐ๊ฑด์ ์์ฒด๋ true์ผ ๊ฒฝ์ฐ์๋ง ์คํ๋๊ธฐ์ ๊ทธ๋ฅ input๋ง ์จ์ค๋ ๋จ
return "true";
}
else (input === false && input2 ===false){
return "false";
}
}
boolean(true, false);
--> 'true'
๐ If - Temperature
function temperature(num){
if(num<=18) {
return "์กฐ๊ธ ์ถฅ๋ค์" ;
}
else if (num>=19 && num<=23){
return "๋ ์จ๊ฐ ์ข๋ค์";
}
else if (num>=24){
return "์กฐ๊ธ ๋ฅ์ต๋๋ค";
}
}
temperature(23)
--> ๋ ์จ๊ฐ ์ข๋ค์
๐ Case - Weekdays
const day = โ์์์ผโ;
switch(day){
case โ์์์ผโ :
โ์์์ผ์
๋๋คโ;
break;
case โํ์์ผโ:
"ํ์์ผ ์
๋๋ค.";
}
--> After switch, case must follow. This is because the user must write the value of Day so that the function is executed.
--> Case is executed even if the logic doesn't match.
--> That's the reason why break is needed. Break literally breaks the function at the point of case where user wants.