Day 371

Chep
4 min readMar 28, 2023

--

Today I’m learning about how web browsers retrieve web pages from various servers hosted across the planet. It’s funny to think that every time we visit a webpage we are in essence just viewing someone else’s computer. Well your client is receiving the software (code) of someone else’s computer and rendering it on your device. Client-server model is what makes up most of our modern day internet.

To get a little more technical when you type a web address into your browser (say twitter.com), it sends a request to Twitter’s servers that hosts the Twitter website. The server then responds with the necessary HTML, CSS, and JavaScript files that make up the web page. The browser then renders these files and displays the web page from your account.

In my class we are using the express framework which is a great framework to use because it simplifies the process of building web servers. It provides pre-built functionality that allows developers to quickly create a web server and handle requests and responses that make up web pages. With Express, developers do not have to custom-write all of the code necessary to get a server up and running. Instead, they can use the pre-built functionality made available via Express to boot up a server quickly and easily. Express also provides guidelines for keeping code organized and efficient, which makes it easier for developers to maintain and update their web applications.

As we get into using express we are focusing on the MVC design pattern. This provides us with guidelines for how we structure our application by creating a separation of concerns split between models, views, and controllers.

Models are used to represent data as objects. They are able to maintain state and store information in memory. We can define methods on models to give them certain behaviors so they can interact with the stored information.

Views are the part of the application that the user actually sees, which boil down to the HTML for what is displayed on the webpage. We can use templating languages to create reusable, dynamic views that combine data and logic into HTML.

Controllers are responsible for the flow of information within an application - they centralize the interactions between models and views. Controllers handle incoming HTTP requests, make use of the Models it needs for information, then passes the data as a response to the appropriate view so the information can be displayed. Our applications are able to process incoming HTTP requests because we create endpoints by setting up routes in the Express router.

As a software engineer, one of the most important things to understand about dynamic routing in Express is the ability to use parts of the URL to create dynamic behavior in your application. By defining dynamic endpoints with placeholder parameters, you can make your application more flexible and user-friendly. These parameters can then be used to retrieve relevant information from a database or API, or to render dynamic views for the client.

Another crucial aspect of dynamic routing in Express is the use of the query string in a URL to create dynamic behavior. The query string is a set of key-value pairs appended to the end of a URL after a question mark. With Express, you can easily access the query string parameters with the req.query object, allowing you to use this information to tailor your application's response. Understanding how to use route parameters and query strings in Express is essential for building dynamic and responsive web applications.

No cap this course has been a lot. Building web applications is rewarding though. Nothing worthwhile is easy! Plus the need for people to build web applications is likely to grow as humanity uses technology more. I don’t want to forget that tech is just a tool. When I take the subway into class it is amazing how many people are on their phones the whole time. I’m not much better except I usually just leverage my airpods to listen to podcasts rather than scroll social media in the morning. I find early morning scrolling leads to headaches.

On another note my Mum visited Boston. Quick trip as she got in late Sunday and left today, but it was awesome getting to see her. It brings me great pride to give my parents a grandchild. Sloan is growing up so fast and I know she has so much family who loves her. Wish my Mum could’ve stayed longer but I’m grateful we got to spend some quality time together. We enjoyed some delicious Mexican at Ole for dinner and I watched a South Park episode about Yelp reviewers after the dinner. South Park is quite grotesque but man do they nail it everytime. Both my Mom and I were cracking up.

3/28/23

Conor Jay Chepenik

--

--

Chep
Chep

Written by Chep

I've decided to write everyday for the rest of my life or until Medium goes out of business.

No responses yet