This week we began learning Node.js and Express.js. Node is a tool used to run asynchronous javascript applications on the server-side. It basically allows you to create a full-stack app (front-end and back-end) that uses one language. Pretty awesome because before that you'd have to know multiple languages to do that sort of thing and learn syntax and convention for them separately. So Node is a beginner's best friend.
Express is a framework for Node that helps manage the server and routing. It's used for RESTful and general web development. I know....what did I just say? So remember in the last post, I explained that an API is just a bunch of useful information that you get from somewhere else. REST (representational state transfer) technology is a style and approach to communicating with APIs. It uses HTTP requests to GET, PUT, POST and DELETE data. And that's what most of the internet is. Think about Facebook, you're getting everyone else's posts, posting your own, deleting the stupid ones, and editing the ones you wrote when you were overly emotional. Facebook is a CRUD app. CRUD is another way of saying RESTful. It stands for Create, Read, Update, and Delete.
So what Express does is it creates a server on the back-end (nothing the end-user is going to see) that has routes that tell it how to search for data, where to find the data, and what to do with the data once it's found. We're using the MVC design pattern to do that. The Model takes the request (get Facebook posts) to server, the Controller determines where and how to get the data and then renders the data in the View (your Facebook homepage with all the posts).
Node and Express don't just know how to do these things. They need some help from modules like psql, body-parser, pg-promise, and method override which I'll get into in a later post. So at the end of the week, we created two fully functional CRUD apps (which I can't link because the server only exists on my computer, but I can tell you about them!). The first is Ada's Pizza. It's an app where we can post our favorite type of pizza, where they originated, and a picture of it. (Post about Ada Lovelace to come as well..)
Express is a framework for Node that helps manage the server and routing. It's used for RESTful and general web development. I know....what did I just say? So remember in the last post, I explained that an API is just a bunch of useful information that you get from somewhere else. REST (representational state transfer) technology is a style and approach to communicating with APIs. It uses HTTP requests to GET, PUT, POST and DELETE data. And that's what most of the internet is. Think about Facebook, you're getting everyone else's posts, posting your own, deleting the stupid ones, and editing the ones you wrote when you were overly emotional. Facebook is a CRUD app. CRUD is another way of saying RESTful. It stands for Create, Read, Update, and Delete.
So what Express does is it creates a server on the back-end (nothing the end-user is going to see) that has routes that tell it how to search for data, where to find the data, and what to do with the data once it's found. We're using the MVC design pattern to do that. The Model takes the request (get Facebook posts) to server, the Controller determines where and how to get the data and then renders the data in the View (your Facebook homepage with all the posts).
Node and Express don't just know how to do these things. They need some help from modules like psql, body-parser, pg-promise, and method override which I'll get into in a later post. So at the end of the week, we created two fully functional CRUD apps (which I can't link because the server only exists on my computer, but I can tell you about them!). The first is Ada's Pizza. It's an app where we can post our favorite type of pizza, where they originated, and a picture of it. (Post about Ada Lovelace to come as well..)
The second one I made myself, it's called Today's To-do and it's a to-do list app where you can add notes on things you have to get done, edit them, change the status to 'done' once you've done them or delete them altogether.
~ Lisa Lou
No comments:
Post a Comment
Let me know what you think....