Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Node.js Basics 2017 Building a Command Line Application Planning Our Project

tal Shnitzer
PLUS
tal Shnitzer
Courses Plus Student 5,242 Points

what is JSON? what is REST?

before I took the basic node.js course I asked if there are prerequisite since there are none mentioned in the course material. I was answered that I need the Javascript basic and Javascript and DOM. so I took it. now I started the node.js and the instructor talks about REST and JSON like I should be familiar with it. so I ask again, Pls help me if you really know: What should I be familiar with before I start the node.js course?

3 Answers

I think in addition to knowing basic javascript you should also know basic server side concepts like routing and what REST APIs are.

JSON: is a data format that is very easy to understand for javascript. Below is a simple example. It basically looks just like a regular javascript object. It allows you to access data with dot notation (employee.name -> returns "alex"). It is a data format just like XML only that JSON is easier to understand for javascript.

{
      employee: {
              name: "alex",
              age: "25"

       }
}

REST stands for Representational state transfer. It often goes together with REST API which is an API that exposes a set of operations (usually in the form of urls) that allows the caller to access resources (like documents or data in the form of JSON).

Consider you had a database with employees stored and you have a REST API that allows people to get data out of your database. You could achieve this by exposing a url like http://myEmployeeAPI/api/employees?name="alex" This would be a GET request to your API and query for employees with the name field 'alex'. The API can then return the data in the JSON form i listed above - which is easy to understand for client side javascript (like after an ajax request)

tal Shnitzer
tal Shnitzer
Courses Plus Student 5,242 Points

thanks Alexandr for you answer. it would really help me if you could direct me to the right courses in treehouse, where I can learn all those things which you mentioned in your answer:

  1. all basic server side concepts like routing and what REST APIs are.
  2. json and generally all courses I have to take in order to become a server side developer on the node.js environment. there is no track for it in treehouse and nobody seems to know the answer for it, and I start to be desperate... thanks again

check this out to learn about rest apis:

https://teamtreehouse.com/library/rest-api-basics

I would also look at some of the digital literacy topic courses. Go to 'Library' and then select the Digital Literacy courses.

To get up to speed with Node.js I would look into the 'Fullstack Javascript' track. Currently there is no track dedicated just for Node.js. The second half of the Fullstack Javascript track focuses on server side node. In the end you will be able to build a fullstack app with your own MongoDB, authentication and front end.

The Node.js courses assume that you have a pretty good understanding of the ins and outs of javascript which is why it is not covered until the second half of the fullstack track.

If you have any questions about JS or Node.js feel free to contact me!

Teacher Russell
Teacher Russell
16,873 Points

Hi, Tal. I've also found it useful to look at the Tracks, for example the Javascript full stack track, and see what course lead up to the course I'm on. JS Basic Track, covers a lot, too, even if it's just in the teacher's notes. If I hadn't already gone through most of the AJAX course.

I do both at work. Recently more client side due to a project to convert our UI to Angular2 . I work for a small company so everyone wears a lot of hats. Unfortunately we don't use Node.js. We use .Net for our server side code base. I do all my personal work with Node.js though! If you want to take a look at what you can do with Node.js after going through the fullstack track take a look at some of my personal projects on github at https://github.com/alabianca