Node.js Tutorial for Beginners – 13 – Creating a Basic Server

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

47 responses to “Node.js Tutorial for Beginners – 13 – Creating a Basic Server”

  1. Arsalan Ahmed Avatar

    You came from heaven to teach me nodeJS .. God Bless you ..

  2. David Pickett Avatar

    I realise that you do not read the comments, but nice stuff. One thing, though, you really need to stop saying "log this out", when you mean to say "write a log message". You are over-subscribing the term 'log out', which really means something entirely different.

  3. Sumit Sapkota Avatar

    what should i put in the port no, cause when i put 8888 it shows error??

  4. David Williamson Avatar

    Thank you, Bucky! I can always count on you to make this kind of thing quick, painless, and clear.

  5. budspencercrew Avatar

    I get "Process finished with exit code 0" – SERVER DOESN'T RUN , even after I copy pasted the exact code from NewBoston GitHub. Any suggestions ( using Webstorm )?

  6. Damien MATHIEU Avatar

    hi,
    how can l do if l want to send a javascript page l did change content type : text/javascript , but it didn't nothing. it sent the javascript itself Thanks a lot

  7. Ribeiro.Itamar Avatar

    interesting, there is only one 'a user made a request' for me

  8. Tito Mordeccai Avatar

    Thanks Bucky. Its the best tutorial for the server.js so far i have watched in youtube

  9. Darell Duma Avatar

    Server Status/Code
    200 OK
    304 Not Modified
    401 Unauthorized
    403 Forbidden
    404 Not Found
    500 Internal Server Error
    503 Service Unavailable

  10. johija69 Avatar

    I was the 500th to like 🙂

  11. Anthony Keys Avatar

    whats the name of this text editor

  12. AKSHAY SHARMA Avatar

    which text editor are you using in this video????

  13. Manas Andhare Avatar

    The Best Tutorial on Node out there. Thanks, It helped a lot ! It's amazing especially for beginners. You have a great way of teaching things.

  14. Yellow Darkblue Avatar

    Woow! This tutorial is awesome! for two days i've been watching all bunch of stuff for hours and i did not understand anything but after this tutorial i know what node.js is, thank you very much

  15. Kisior Avatar

    The best tutorial i`ve even seen, rlly, thank you

  16. Shibolet 3 Avatar

    THANK YOU FOR UNDOING ALL THE BULLSHIT I HEARD
    THANK YOU
    sorry

  17. Rustam Kamberov Avatar

    hey Bucky, thanks for the tutorial. I am also using IntelliJ but for some reason auto-complete does not offer "writeHead" method for the "response" object. It works fine after I hard coded. Additionally, methods writeHead and createServer are underlined with a wavy line. Much appreciate for the response on this matter. Thanks.

  18. Endrit Llenga Avatar

    The cat in GitHub is white, the background is black 🙂

  19. Nagaraj.D Amarnath Avatar

    Hi,I am using sublime text 3 for this tutorial as it is convenient for me to type and also due to a lot of cool features.I have written the same code for this creating server tutorial.I get the message in the Console as "Server has started" but there on no output in the log and also in the browser I get server not found. :(Please guide me, do I need to download some package?.Thanks in advance!.

  20. Douglas Dunn Avatar

    How do you get that autocomplete on sublime text

  21. An Luong Avatar

    If every single time you refresh the webpage, onRequest() run twice, so how come "Here is some data" only printed once on web page? Is it suppose to be twice???

  22. J Z Avatar

    Why my node.js does not have require() function ! It is saying Unresolved function ! I am using student version, is this the reason ??? Thanks for your video,.

  23. Manuel Quintanilla Avatar

    How exactly will I be loading the style.css in the handleRequest function? WIll I have to write a seperat function for node to also pull the style.css???

  24. DaCurse0 Avatar

    I made it.. FINALLY!
    DeltaStrikerDoS and
    DeltaHavocDDos with DeltaDisease(infecting virus)
    darknet hex

  25. Moustafa Magdy Avatar

    why is how to deal with databases not included in this course!!!

  26. revosys Avatar

    Nice video brother… Please guide how to add NODE.JS into bundle.js using browserify as i m getting
    ERROR : ReferenceError: require is not defined

  27. security00girl Avatar

    Why is it that when the request.url is printed in the console it shows both the / and the /favicon.ico requests but if you do response.write(request.url), in the browser it only shows the / request?

  28. JayDee Avatar

    When i run the code it just stops immediately on it's own. no text in the terminal, nothing. It simply stops. Help?

  29. Vikas Choudhary Avatar

    Bucky you made it so easy man. Thanks!

  30. Pocket Agar Avatar

    i am here for agar.io bots do u know how to create agar io bots please create a video then

  31. Kamlesh Mevada Avatar

    How to create SMPP server using node.js

  32. Stav7 Avatar

    but…i'm confused..
    so basically we are creating apache…?
    but with javascript?
    wot. why? isn't that gonna be like insanely slow?

  33. Ankit Jain Avatar

    response.writeHead(200, ["Context-Type": "text/plain"]);
    ^
    SyntaxError: Unexpected token :

    Any help that i can get ?

  34. James Wainwright Avatar

    Is it best to use node with express for web servers? Or just plain node?

  35. acestu Avatar

    Thanks, you were born to teach !

  36. randy vroegop Avatar

    epic how these tutorials work for me, unlike many others where they skip details!

  37. Hitesh Sutar Avatar

    on second run its giving me some error
    events.js:141
    throw er; // Unhandled 'error' event
    ^

    Error: listen EADDRINUSE :::8888
    at Object.exports._errnoException (util.js:837:11)
    at exports._exceptionWithHostPort (util.js:860:20)
    at Server._listen2 (net.js:1231:14)
    at listen (net.js:1267:10)
    at Server.listen (net.js:1363:5)
    at Object.<anonymous> (C:UsersVishalDesktopHTML5Applicationpublic_htmlServer2.js:9:30)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)

  38. Arkadiusz Dylewski Avatar

    "favicons" are not these icons on your website, but the icon just before the name of the page on your toolbar 🙂

  39. Dhamodaran Kanniappan Avatar

    Hi all, I typed the same code. But the server is not connecting to browser. I have also checked the firewall settings, permission is already given to Node.js.

    var http = require('http');

    function onRequest(request, response){
    console.log("A user made a request" + request.url);
    response.writeHead(200, {"Content-Type": "text/plain"});
    response.write("Here is some data");
    response.end();
    }

    http.createServer(onRequest).listen(8888);
    console.log("Server is now running…");

    Any guidance would be rally helpful to me.

  40. ehguacho2008 Avatar

    you had a typo there: you've typed "context-type" instead of "content-type". too much js, probably XD

  41. Moon Ahmed Avatar

    great video so helpful!!

  42. khanh le viet Avatar

    Finally, this is what I am waiting for. Tks.

  43. MicroUrb Avatar

    This did not work for me, any suggestions?

  44. Thiago Araujo Avatar

    Bucky, MANY THANKS for this set of videos. I'm starting to work with Node.js for some Big Data applications and it helped me a LOT. I've already recommended to all my colleges that will work with me. Thanks again!

Leave a Reply

Your email address will not be published. Required fields are marked *