r/learnjavascript • u/portexe • May 30 '20
I Turned A Raspberry Pi Into A Node.js Web Server
https://www.youtube.com/watch?v=iSAF8D8rp0o2
u/lokriet May 30 '20
I literally just learned about their existence yesterday, and now there's articles about them everywhere. Talk about Baader Meinhof phenomenon xD
9
u/portexe May 30 '20
And now that I know that effect is called the Baader-Meinhof Phenomenon, I’m going to be hearing that word a lot now.
1
1
8
1
u/Jnsjknn May 30 '20
What a coincidence. I just did the same thing this week. If you (OP) or anyone else want to chat about ideas or problems with RPi + Nodejs, feel free to hit me up.
1
u/portexe May 30 '20
What sort of problems did you run into?
1
u/Jnsjknn May 30 '20
Not much problems so far, although I've only really used it to test that it works.
Only time I got stuck was when I was trying to make the server accessible from outside my local network. I somehow couldn't figure out how to do the port forwarding but it ended up being extremely simple.
1
3
u/pmacking May 30 '20
What exactly would this pi setup provide you that you couldn’t do from your computer? ... new to this domain myself
8
u/mitwilsch May 30 '20
Servers run all the time. You can Host a webserver from your computer, until you turn it off.
You can buy another equally powerful computer and leave that on all day and night. Then cry over your electric bill.
You can also host with a cloud service, or server provider. Who have access limits, and cost money.
Pi is the cheap, low-power, DIY server that you control. Until your app gets really big or popular, then you can buy the fancy servers.
2
2
1
u/2dP_rdg May 30 '20
technically, nothing. The idea of "I turned a Raspberry Pi into a Node.js Web Server" is right up there with "I turned [any computer] into a Node.js server"... it's not really much of an accomplishment.. But the reason to do a Pi instead of your computer would be that the Pi (assuming it meets web traffic demands or sits behind a CDN to alleviate stress) consumes far less power and could be left on 24/7 with minimal impact to your electricity bill. Could even go as far as to power it with a solar panel/battery setup.
2
u/Beermedear May 30 '20
This was really useful - I be been wanting to do something similar - time to get cracking!
2
1
u/reforitor May 31 '20
Hey, great content dude! But could you please change the mic placement? It's kinda distracting :")
0
May 30 '20
[deleted]
17
u/portexe May 30 '20
Maybe not, but it was very fun and I loved documenting the process. I have a feeling that there are a lot of developers who have heard of Raspberry Pi, but have not really seen much about it that seems relatable. I'm hoping this will kind of be a more relatable DIY project video for us webdev's.
15
u/Beermedear May 30 '20
Check the sub you’re in. No reason to bring that type of attitude - it’s a video aimed at helping others with no ads, no asks for patreon, etc. Just a dude sharing a concise, helpful guide.
0
u/sgthoppy May 31 '20
Doesn't have anything to do with learning javascript, though. He already knows javascript, or at least enough to know what node is and its toolset (
nvmandnpm). He hosts an open-source file storage site without touching any javascript himself, except for those 5 frames where code is shown at 5:45, and it looks like it's just pasted from a tutorial, as it spontaneously appears in a previously empty file.Not to mention the bad practice setting permissions on
/srvto777.
14
u/loueed May 30 '20
Great video man. I wonder if you could configure your rooter to access this from the internet. You could then stick cloudflare in front of it to handle traffic. Could be a cheap solution to host a static site 👍