Server Talk

I can’t believe I haven’t posted all week! Actually, yes I can. This week has been crammed full of new concepts not to mention the crash course that I was a lead instructor for last night! Where to even begin.

This whole week has been about communicating with the server. First we learned the very basics – how to host a local server on your machine! Pretty cool stuff. Then we learned how to render an html file to a page by talking to the server (called routing/dynamic routing). Next we started installing some modules for Node that make life a little easier. These packages are basically code that other developers have written over time that help automate the things we as programmers need to accomplish. There are tons of libraries out there and they all serve some specific purpose. We’ve been mainly using express, mustache, body-parser, cookie-parser and validator. We’ve been able to create data, import data and modify data using these tools and Node. It hasn’t been easy, but it’s very cool stuff we are learning.

I’ve definitely been feeling the frustration this week. The first half of the week I was basically a frustrated mess. I found myself in a generally unpleasant mood most of Monday and Tuesday. It’s a lot of new information and I don’t like not being able to understand all of it right away. Luckily I was able to check in with myself Tuesday evening and just kind of hit the reset button. The past two days, though still trying, have been so much better because of it. I think our whole class is slightly behind where we should be right now, maybe by a day or half a day, but things are starting to click for me. A problem I couldn’t solve last night I was able to solve after our lecture today. It was pertaining to a project which required us to to create a todo list and render the items to the page every time an item was added, but the tricky part was we also needed to be able to cross the items off the list when they were complete. The part that got me yesterday was knowing how to get that information back to the server when the user checked that a task was complete. Fortunately I was able to work at it today and got the answer! I had been trying to use a PUT method, however what I didn’t know at the time was that html forms only allow for GET and POST methods! I also was able to add a little JSON flair so that the list becomes somewhat permanent. Instead of the data being wiped clean when the server connection is interrupted, the server writes to a JSON file which remains unaffected by the server connection! Here’s a little glimpse at the ‘requires’ used to set up the app/server!

Screen Shot 2017-06-22 at 9.03.28 PM

The next piece is authentication! We will be using and setting cookies to track sessions for users as they log in and sign up! We did a little bit of that today by building our own ‘middlewares’ (a piece of code the user must ‘pass through’ in order to get to the next page), but we will be learning a neat little module for sessions tomorrow which will help tremendously with our current project(creating an app that stores user login info and counts the number of times they have visited the webpage)!

I’m a little nervous for the workload this weekend, but as always I’m confident that I’ll be able to conquer whatever is thrown my way!

The crash course last night was super fun! It was a relatively small group so it was pretty engaging and intimate. Bruin and I were told we did an awesome job and it felt natural to be up there talking about coding. Here’s us leading the course:

that’s me behind the computer!

I really loved the experience and would absolutely love to do it again, especially if I could be a part of the development of the material. The only thing that was slightly unfortunate was that the course was in the middle of the toughest week so far! If I can get through this week, I can do anything!

I’ll definitely try to be better about posting, this week was just a different beast unto itself. I’m sure I’ll be posting about our weekend project and updating more frequently from now on!

Gotta get back to the grind!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s