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 trialPeter Retvari
Full Stack JavaScript Techdegree Student 8,392 PointsWhy do we need to create a webserver?
Hi folks, I'm a little bit confused with this project: build a simple dynamic site with Node.js. In generally I understand these concepts:
1) Why we are using AJAX? => because it's a non-blocking language and we can use Javascript and don't have to learn PHP or something, and it's also quick, easy and effective. Got it.
2) Why we have to use server in general? => because you can't run a website without a server :) you need to store your clients data, you need to protect it and hide it from the clients as well. Got it.
But... in this case(build dynamic website...) if we are accessing the student's data trough www.teamtreehouse.com and we are sending request to the treehouse's web server, WHY WE HAVE TO BUILD OUR OWN WEB-SERVER if we just request data from treehouse and display it in a fancy environment in the browser with html and css?
Am I wrong? I just started this part of the course, but I wanted to clear it before I dive deep into it.
1 Answer
Ceil-Ian Maralit
Front End Web Development Techdegree Graduate 19,434 PointsHi Peter,
I believe your question is why do we need our to build our own server rather than just using other’s, right? There is a lot of factors to consider here but let me just lay a few...
We need to have our own server because this example of this course is not always the case in real life.
When putting something in your website and it is a vital part of it, you may not want to depend on other server by requesting everytime someone requests for your website, because this can affect performance.
Did you know that when you request a lot on google maps and made their service slow, they will charge you money? :) same as the other if you will depend mainly on them, if they won’t charge you, they will terminate their service for you. This a factor to consider that you don’t know how many people will use your website or app, the server could get overwhelmed.
Plus, if the server you are relying on goes down, your whole project goes down too because you have that as the most vital part of your project. Not unless it’s not that important.
I hope this helps!
Best, —Ceil
Ceil-Ian Maralit
Front End Web Development Techdegree Graduate 19,434 PointsCeil-Ian Maralit
Front End Web Development Techdegree Graduate 19,434 PointsOne more thing. PHP is a great language, most especially when combined with SQL. You may or may not encounter it in the future, but if you do, you will enjoy it too! :)
Peter Retvari
Full Stack JavaScript Techdegree Student 8,392 PointsPeter Retvari
Full Stack JavaScript Techdegree Student 8,392 PointsWow, many thanks for your quick and detailed answer. Helped a lot. I will check PHP definitely after the Techdegree. Thanks 😉
Ceil-Ian Maralit
Front End Web Development Techdegree Graduate 19,434 PointsCeil-Ian Maralit
Front End Web Development Techdegree Graduate 19,434 PointsHappy to help! Feel free to ask in the community when you get stuck on some problems! Happy coding! :D
Best,
—Ceil