Skip to main content

Intro to Backend: Is Browser The Only Place To Send HTTP Request?


Today,  I begin to learn the second part of web develop course: backend.

Frontend is the stuff that we can see and interactive with, such as HTML, CSS, and JS. We can type our code, style our page, or write some function to make interaction. However, backend is everything else.

For example, we type Target web address in the Internet Browser.



As we hit "enter", there are a few steps to go through:

1. The HTTP request is sent to a particular server's IP address.
2. The server figures out what to send us
3. It sends a HTTP response back to us

Those process we are hard to see, and it happens in less than one second.

The instructor said that the browser is not the only place to send the HTTP request, and there are so many choices out there. In this learning course, we are going to use Postman App.


Postman allows us to make HTTP requests and viewer responses. It is really for developers to understand how things are working or debug something.

In the Postman App, we can choose different types of request.


The most important and frequent use of requests are:

1. Get: it is for retrieving information
2. Post: it is for posting new information to database such as sign up for a website
3. Put & Patch: it is for updating things or editing them
4. Delete: it is for deleting things

For now, these information are some basic concept to start with. As I continue to learn the course, I will share more study notes with you.

Comments

Popular posts from this blog

GIT Study Note: Six Git Commands You Should Know!

What is Git? According to Git website , Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Basically, we can use Git to track all of changes and revert them back if we made mistakes. The version control system is a way for us to work with different versions of our code, so that we can save different features and make notes as we progress. It is also very useful for team collaboration. Six Git Command You Should Know 1. Git Init In our server, we need to create a "Git" directory and inside of "Git", we make another direcory "git_inro". Then, we add a file "app,js" in the "git_intro" folder. The first thing we need to run is "git init" . When we run git init, it will make a directory which is hidden called ".git". Wherever I run that git init command, it's going to track all of our changes. ...

Intermediate Express.Js: Write Conditions and Loops In The EJS (study note)

We continue to use the app.js which we have build to be the study example. In the last post, we only add a simple EJS tag <%= thingVar %> inside h1 tag. This will match the "thing" to any "thing" request from the user. If Statement Today, the course shows us to write a simple if statement in the EJS file. I learn to apply it to my own app. In the if statement, if users send"/wantto/workout" request, the page will show a new content "Good Idea!". We wrote the if statement in the "diet.ejs" file, and we add "<% %>" tags around the code. We have to wrap every line of JavaScript anytime JavaScript starts and ends. Moreover, you may see there are two types of ejs tags here: <%= %> The one with equal sign. According to the course, when we add equal sign, the value that is returned inside of the tag will be rendered to the HTML page. it will be added to the HTML. For example, if we write ...

Express.js Study Note: Route Order Is Matters!

Last post, I have learned to develop my first Express App from the course. Basically,  it has three routes. When we type "/", "/bye" and "/cat", the app will receive the request and send the matched response to us. But, if we want to send a nice message when users type other texts after slash, what should we do? We can write a "*" route which will run whenever out app gets any request to any url aside from those three routes that we have already defined. app.get("*", function) In the App.js file, we add a new star route, and it will send you a new message whenever you type any undefined request. I run my app, and put some random texts after slash, and hit enter. All I get is "You are a star!". If we move the star route to the top of those three routes, what will happen? The instructor run the app, the result is even though we send the "/", "/bye" or "/cat" request, all we get...