These are chat archives for FreeCodeCamp/Help

11th
May 2018
Orangecat
@xiongwei1994
May 11 2018 09:00
lol
May Kittens Devour Your Soul
@diomed
May 11 2018 09:12
link me, daddy!
Claudio Restifo
@Marmiz
May 11 2018 09:52
:link: :link: :link:
Kranti Nebhwani
@darkphotonKN
May 11 2018 11:32
does anyone know how nodejs works? I learned some tutorials but I don't understand how it fits in with the "html, css, javascript" for a site atm, can I just write nodejs code within my javascript file and it will work? So first half of file is the standard javascript controller adding / removing classes etc and second half is nodejs code just doing some server stuff
Stephen James
@sjames1958gm
May 11 2018 11:40
@darkphotonKN
nodejs has nothing to do with html, css for a website. nodejs runs javascript code in a process on a server.
There are tools/libraries that run in nodejs that allow nodejs to serve up html, css and js for a web page but those still "run" in the browser.
Kranti Nebhwani
@darkphotonKN
May 11 2018 11:41
@sjames1958gm but don't your server with nodejs do things for a site? If I have asite with html, designed with sass and jaavscript used in some functionality can I not use nodejs to add features to it that only a server side language can?
Stephen James
@sjames1958gm
May 11 2018 11:42
Now electron, which is nodejs combined with the webview from chrome allows you to create server apps that also can display html, css and javascript
@darkphotonKN Yes, it runs on the server side and can process and create HTML, css that is then displayed on the web page.
Kranti Nebhwani
@darkphotonKN
May 11 2018 11:43
@sjames1958gm is there no way without elecrton? I mean how can every single nodejs code be independent of any site. Aren't there sites that include functionality that was done by nodejs code but the looks were made with html and css
@sjames1958gm let me rephrase my question as it's a bit specific
Stephen James
@sjames1958gm
May 11 2018 11:44
nodejs can definitely provide the server functionality to deliver content to a browser.
Kranti Nebhwani
@darkphotonKN
May 11 2018 11:44
@sjames1958gm if there was a site, made from the standard html/ css/ js. Is there no way for someone knowing nodejs, to then use his knowledge to take information from the js / html to do server side functionality?
@sjames1958gm that's what im asking, how do I go about using nodejs to be "part of" an already existing website, to add to it that plain html/ css/ js can't do. If an old website needs to do some emailing stuff that only server side languages can, nodejs can do it right
do I create a new folder with nodejs code that refers to the html/css/js of the main site?
initiating the node and the required stuff with command line in that folder
Stephen James
@sjames1958gm
May 11 2018 11:50
@darkphotonKN There are many ways to do what you want. Creating an new folder for your nodejs code is probably a good starting point.
You could also have specific URLs in your site that are directed to the nodejs code for that specific functionality.
Your web server Apache, Nginx or the like could route specific URLs to old and new code
Kranti Nebhwani
@darkphotonKN
May 11 2018 11:52
@sjames1958gm ok thank you, ill try do some research. I'm quite new to the concept of the server side stuff. I can write jaavscript pretty well so I learned the nodejs tutorials pretty fast but didnt know how it fit in to the "larger picture" of the sites I make. Thanks for clearing that up
CamperBot
@camperbot
May 11 2018 11:52
darkphotonkn sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 9238 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
May 11 2018 11:53
@darkphotonKN Good luck. There are lots of tutorial on using nodejs, especially with packages like expressjs for providing web site functionality in nodejs
Kranti Nebhwani
@darkphotonKN
May 11 2018 11:56
@sjames1958gm awesome, noted down expressjs too :)
Stephen James
@sjames1958gm
May 11 2018 11:57
@darkphotonKN :+1:
Christopher McCormack
@cmccormack
May 11 2018 16:24
@sjames1958gm are you real familiar with nodejs/express?
Nazar
@IsaakNazar
May 11 2018 16:35
resize page to <= 650px double click to hamburger menu, and resize back to normal size and menu disappearing, any suggestions?
codepen link
May Kittens Devour Your Soul
@diomed
May 11 2018 16:40
did any1 here use wikipedia api?
Nazar
@IsaakNazar
May 11 2018 16:41
I did
May Kittens Devour Your Soul
@diomed
May 11 2018 16:41
what is is good for? like, what kind of data can you get through it
can u get only bits of article?
like list of names for example
Nazar
@IsaakNazar
May 11 2018 16:42
I made wikipedia viewer
you can get list of names and also list of articles
but there was restriction. only 10 articles per query
Christopher McCormack
@cmccormack
May 11 2018 16:44
@IsaakNazar you're making the menu disappear nav.style.display = 'none';
Nazar
@IsaakNazar
May 11 2018 16:46
@cmccormack the purpose of that line to toggle menu when click hamburger
Christopher McCormack
@cmccormack
May 11 2018 16:47
sorry @IsaakNazar didn't read closely enough
Nazar
@IsaakNazar
May 11 2018 16:48
@cmccormack but you are right, that line toggles the navbar
maybe I need to create separate menu for hamburger?
Christopher McCormack
@cmccormack
May 11 2018 16:48
@IsaakNazar put a display: block in your media query so it shows again when you make it bigger
Nazar
@IsaakNazar
May 11 2018 16:49

@cmccormack

@media screen and (min-width: 651px) {
  div.main_nav_container.nav_positionfixed {
    display: block;
  }
  .navcontainer {
    display: block;
  }
}

?

May Kittens Devour Your Soul
@diomed
May 11 2018 16:51
what kind of names? @IsaakNazar
like , can I get a list of GOT episodes
Nazar
@IsaakNazar
May 11 2018 16:52
@diomed Titles, github
May Kittens Devour Your Soul
@diomed
May 11 2018 16:53
you've picked nice font
Nazar
@IsaakNazar
May 11 2018 16:54
@diomed :smile:
@cmccormack Chris, where exactly I gotta put display:block?
Christopher McCormack
@cmccormack
May 11 2018 16:58
@IsaakNazar wherever your media query is invoked when the screen is larger than your specified pixels. Sorry I am working now so haven't been able to look much into it
Nazar
@IsaakNazar
May 11 2018 17:00
@cmccormack ah ok, thx anyway
CamperBot
@camperbot
May 11 2018 17:00
isaaknazar sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1447 | @cmccormack |http://www.freecodecamp.org/cmccormack
Kyle Holm
@thekholm80
May 11 2018 17:20
hello, /help