기본 콘텐츠로 건너뛰기

12월, 2019의 게시물 표시

req.params.id ?? PARAM??

WHAT IS REQ.PARAM?! req.params an object containing parameter values parsed FROM THE URL PATH FROM THE URL PATH PARAMETER VALUES PARSED FRO THE URL PATH BEAUTIFUL as router.route("/:id").get((req,res) => {}) it takes the id, which is A PARAMETER VALUE PARSED FROM THE URL PATH you know what im saying.

Forgetful anonymous function!!!

(req, res) => {} IT MEANS req and res are PARAMETERS passed into this anonymous function. Writing middleware for use in Express apps middleware functions are functions that have access to the request object, the response object and the next function in the application's request- response cycle. the next function is a function in the .... https://expressjs.com/en/guide/writing-middleware.html

What is axios? axios study

http://webframeworks.kr/tutorials/nextjs/nextjs-006/ Axios is a promise based HTTP cliend for the brower and node js by its github but. what is it actually??! Features make XMLHttpRequests from the browser make HTTP requrest from nodejs // maybe even though we do not set the whole new routing file //it can do its job when applied in frontend or react zone. i donno yet supports the promise API intercept request and response transform request and response data cancel request automatic transform for JSON data client side support for protecting against XSRF

error 400 : bad request

My MERN page that i commited after checking that it worked perfect as tutorial with the error fixed last night, made new error... -this is my precious non-error last page scene. fun thing is that I stayed up doing it and getting my nail done because.. i could not sleep  ¯\_(ツ)_/¯ then I got up late, missed a date. fuck me I costed time and energy to work this page out and this bitch ditched me and show me new error yeah take its toll on me all my fault. I still love programming lol. what keeps you insane and weirdly obsessed with is something you have to keep closer. I think this is passion somehow. time to try trouble shooting and debugging the word debugging reminds me of my biggest hatred to prof. park. I wish you are happy by now sir. https://airbrake.io/blog/http-errors/400-bad-request will come back later.. ///////////// I GOT THIS Ok the error was shown only as a bad request and some of my research suggested me delete the site cookie to fix, here is w

you need to enable Javascript....dat problematic message

this error message can be shown from different situations. literally not enabling it from your web browser could and etc. but in my case, it was caused because i was running only react app not the server.js file with npm. I know it sounds stupid but...thats me I guess. so when I follow youtube tutorial, they mostly shoot 1-2h long video it at once. And i play it time to time, pause it and continue, i forgot how should i be running the server. in the current one, the instructor turned on 3 terminals on VS code. first one to run : nodemon server second to run : nodemon start (to start react app, the frontend) third one for package installing and rest of tasks //sketch starting react app does not run my dynamic server, as when I turn on react app typing npm start i should run npm server!! so that it makes request

How to save changes to another branch?(UNCOMMITED)

https://stackoverflow.com/questions/2944469/how-to-commit-my-current-changes-to-a-different-branch-in-git https://www.atlassian.com/git/tutorials/saving-changes/git-stash Stashing your work The git stash command takes your UNCOMMITED CHANGES (both staged or unstaged), saves them away for LATER USE, and then reverts them from your working copy. at this point you are free to make changes, create new commits, switch branches, and perfom any other Git operation. then come back and re-apply your stash when you are ready git stash pop -popping REMOVES THE CHANGES FROM YOUR STASH and reapplies them to your working copy git stash apply -alternatively you can reapply the changes to your working directory AND KEEP THEM IN YOUR STASH

What is JSX?

JSX allow us to write HTML elements in JavaScript and place them in the DOM (Document Object Model) without any createElement() and / or appendChild() methods. JSX convers HTML tags into react elements EXAMPLES with JSX const elem = <h1> I love JSX!</h1>; ReactDOM.render(elem, document.getElementById('root')); without JSX const elem = React.createElement('h1', {}, 'I do not use JSX!'); ReactDOM.render(elem, document.getElementById('root')); Expressions The expressions can be a React variable, or property, or any other valid JS expression const elem = <h1>{5 + 5} is 10</h1>

What is snap install?

Snap(also known as snappy) is a software deployment and package management system built by Canonical. The packages, are usually called 'snaps' and the tool for using them is called 'snapd', which works across a range of Linux distribution and therefore allows distro-agnostic upstream software deployment.

What is routing in Express? EDIT : WHAT IS EXPRESS

Routing refers to how an application's endpoints(URLs) respond to client requests. app.get() to handle GET request app.post() to handle POST request all.app() to handle all http methods app.use() to specify middleware as a callback function (handler func) with multiple callback functions, it is important to provide NEXT as an argument to callback fuction and then call next() within the body of the function to hand off control to the next callback. resource :  https://expressjs.com/en/guide/routing.html EXPRESS :  https://expressjs.com/en/guide/using-middleware.html Express is a routing and middleware web framework that has minimal functionality of its own. An express application is essentially a series of middleware function calls. IF THE CURRENT MIDDLEWARE FUNCTION DOES NOT END THE REQ-REP CYCLE, IT MUST CALL NEXT() TO PASS CONTROL TO THE NEXT MIDDLEWARE FUNCTION. OTHERWISE, THE REQUEST WILL BE LEFT HANGING.

What is app.use?

app.use is a way to register middleware or chain of middlewares (or multiple middlewares) before excuting any end rout logic or intermediary route logic depending upon order or middleware registration resource :  https://stackoverflow.com/questions/11321635/nodejs-express-what-is-app-use 3 Json means JavaScript Object Notation

How to rename a branch?

1. git branch -m -when i am on the branch I want to rename 1-1 git branch -m oldName newName -when i am not on the branch 2. git push origin :oldName newName - delete the old name remote branch and push the new name local branch 2-1 git checkout newname -git switch to new name branch 3. git push origin -u newName - reset the upstream branch for the new name local branch. switch to the branch and then :

git status, branch

git status shows tracked and untracked, added and unadded files by git git branch -a shows all the branches, local AND remote from the project including HEAD point git checkout -b newBranchName makes new branch and switch to it -b enables to make a new branch. without the flag, checkout does its job with existing branchName. It moves the head point to the branch. DELETING A BRANCH LOCAL git checkout -d branchName git checkout -D branchName -d deletes the branchName -D option stands for --delete --force, which deletes the branch regardless of its push and merge status, so be careful using this one!! REMOTE git push <remoteName> --delete <branchName> or -d for alias of delete. checkout = an act of switching between different versions of target entities https://www.atlassian.com/git/tutorials/using-branches/git-checkout deleting a branch source :  https://koukia.ca/delete-a-local-and-a-remote-git-branch-61df0b10d323

git add

git add . will only add files located in the root directory. git add all Find all new and updated files everywhere throughout the project and add them to the staging area git add <file> stage all changes in file for the next commit git add <directory> stage all changes in <directory> for the next commit git add -p begin an interactive staging session that lets you choose portions of a file to add to the next commit. This will present you with a chunk of changes and prompt you for a command. use y to stage the chunk, n to ignore the chunk, s to split it into smaller chunks, e to manually edit the chunk, and q to exit resource :  https://rubygarage.org/blog/most-basic-git-commands-with-examples resource :  https://www.atlassian.com/git/tutorials/saving-changes

What is require and module?

Module means : "Each of a set of standardized parts or independent units that can be used to construct a more complex structure, such as an item of furniture or a building" from google dictionary. I can easily find which words should be replaced with programming terms and get a rough idea what it is in Node js. I assume all of you will as well. What is require? source : https://steemit.com/utopian-io/@sagorahmed/node-js-basic-tutorial Once a module is created, it could be exported and used by require func. Or we simply require it from installed packages. like express or http. well I handily installed express trying mern tutorial now but haven't required http nor installed it yet. I will see soon enough tho. -How to create a module export.myDateTime = function(){ return Date() } -How to include dt = require('./myfirstmodule') I could have used naver blog which is way more neat and fancy with provided decoration tools for postings a

What is master and origin in Git?

>git push -u origin master this is a line that I enter to finish up to upload a file that I worked in github. but the question is, what are they??? origin and master? origin "origin" is a shorthand name for the remote repository that a project was originally cloned from. More precisely, IT IS USED INSTEAD OF THAT ORIGINAL REPOSITORY'S URL -and thereby makes referencing much easier. so it is a shorthand name of the git URL. simple. master "master" is a naming convention for a branch. After cloning(downloading) a project from a remote server, the resulting local repository has a single local branch : the so-called "master" branch. This means that "master" CAN BE SEEN AS A REPOSITORY'S "DEFAULT" BRANCH. default branch when just cloned. simple! references :  https://www.git-tower.com/learn/git/glossary