30th
Jan 2018
Ghost
@ghost~5a3ac208d73408ce4f843d6a
Jan 30 2018 00:01 UTC
@thekholm80
@WebDevDeja you mean vertical? it's the wrap guide. you could have just googled it, the correct answer is the first search result for "vertical line atom"
Ghost
@ghost~5a3ac208d73408ce4f843d6a
Jan 30 2018 00:06 UTC
Oh, derp, I've googled everything else but that
Kyle Holm
@thekholm80
Jan 30 2018 00:06 UTC
@WebDevDeja click Edit => Preferences => Packages (scroll to bottom) => wrap-guide => disable
wrap guide so gooooooooooooooooood tho
hate it being displayed like that tho, yuck
Ghost
@ghost~5a3ac208d73408ce4f843d6a
Jan 30 2018 00:07 UTC
Why? I feel like it in my way but if there's a way I could use it to my advantage I'll keep it
Kyle Holm
@thekholm80
Jan 30 2018 00:08 UTC
my window isn't wide enough to show the wrap-guide lol
well some editors are hard to navigate when your lines go past your screen width, wrapping is really nice in those cases
then again my mouse should have horizontal scroll, i should set that up :c
Kyle Holm
@thekholm80
Jan 30 2018 00:10 UTC
aww yis this horizontal scroll feels so weird tho
Kyle Holm
@thekholm80
Jan 30 2018 00:10 UTC
love having ALL THE FILES open at the same time lol
hackerman split window
me
i do that so often, it's the same with tabs
in chrome i mean
Kyle Holm
@thekholm80
Jan 30 2018 00:11 UTC
yeah
i have like 50 open at a time when i'm researching and i only close anything when i start losing myself and duplicating the same tabs :x
Kyle Holm
@thekholm80
Jan 30 2018 00:11 UTC
it's a great feeling closing all the tabs though
oh yes
i take great pleasure in that too, i close them one by one on purpose cuz i feel like a god while doing it
Kyle Holm
@thekholm80
Jan 30 2018 00:12 UTC
haha yep
and then i open 50 new ones because i got another idea of what i could do
it's lonely doing all projects on your own tho
hmu if there are any lamps here (only organic ones pls)
Kyle Holm
@thekholm80
Jan 30 2018 00:14 UTC
mern or gtfo
:P
mean is a more popular stack tho (still) yikes
Kyle Holm
@thekholm80
Jan 30 2018 00:15 UTC
angular is not growing much anymore
tbh i wanna do something in angular
or react, i don't really care
Kyle Holm
@thekholm80
Jan 30 2018 00:15 UTC
I've never really tried angular
some front end framework i can go full out on
Kyle Holm
@thekholm80
Jan 30 2018 00:15 UTC
react is fun though
i learned some angular 1 and that was the end of it lmao
so kyle what kinda projects are you working on
Kyle Holm
@thekholm80
Jan 30 2018 00:16 UTC
umm
personal ones
Kyle Holm
@thekholm80
Jan 30 2018 00:16 UTC
arts & crafts
haven't really been writing much code lately
ohoh i've been binging on sculpting and doll repainting :x
Bjorn van de Peut
@bjorno43
Jan 30 2018 00:17 UTC
Some project I've been working on lately: https://www.icecub.nl/PairProgramming/#-L43Q43rRAx4lUyR8KzJ (top bar doesn't work yet)
videos, i can't do that stuff to save my life
Kyle Holm
@thekholm80
Jan 30 2018 00:17 UTC
I've been trying leather working, film making and photography
it's kind of boring
there's just one div .-.
oh i see
jesus
i was like "what the editor is basically empty what kind of a pair programming project is that" lmao
Bjorn van de Peut
@bjorno43
Jan 30 2018 00:19 UTC
Haha
is it real time? i wanted to implement real time editing as an option for my project too
but i'm working on a platform for ez website creation
Kyle Holm
@thekholm80
Jan 30 2018 00:21 UTC
I've used socket.io to make a chatroom - it was not fun
Bjorn van de Peut
@bjorno43
Jan 30 2018 00:21 UTC
Yup. Well, for as far as real time goes. There's always lag / delay depending on the users connection of course
Kyle Holm
@thekholm80
Jan 30 2018 00:21 UTC
i'm looking forward to trying graphql's subscribe functionality
yeah, you can't go against people's ping
how did you handle the inconsistency caused by lag when 2 users are editing the same line?
most people just apply literally no lock on the file, i think people should be able to mark their area and lock other people out of changing them
Bjorn van de Peut
@bjorno43
Jan 30 2018 00:23 UTC
I didn't. I've simply used https://firepad.io/ for this one. Made it quite easy. But I plan to create my own using OT.js (which pretty much every real time editor out there uses)
you need help? :33333333333333333333333333
Bjorn van de Peut
@bjorno43
Jan 30 2018 00:24 UTC
Probabely. The documentation on OT.js is terrible. Getting to understand it will be a pain :P
i'm interested O u O
hmu with the repo link if you want some dope amazeballs help with this one
Bjorn van de Peut
@bjorno43
Jan 30 2018 00:26 UTC
@RuinIsProbablyTaken Hmm. And here is actually an example project written by someone. Could be very usefull: https://github.com/YingshanDeng/SharedPen
Chris Cullen
@123xylem
Jan 30 2018 00:49 UTC

Chris Cullen @123xylem 10:49
Hi. I have this number from an api . 546798150000000000
But it should be 0.546798150000000000

Im trying to make it that number with the following code

var data = JSON.parse(body); //Data from the body

var balance =
Number(data["result"]/(Number(data["result"])*10)); // Make the data[result] The number and then do maths to it to add a 0. infront of it
Any idea how?

@bjorno43 where do the lies end, bob
i meant like your project's repo
i can google ot-related info myself xd
Kyle Holm
@thekholm80
Jan 30 2018 01:14 UTC
at least he didn't say it uses blockchain
tbh i'm used to no docs cuz i generally don't look at docs unless it's a huge library or it's something i can't take apart myself owo the source tells no lies
Bjorn van de Peut
@bjorno43
Jan 30 2018 01:32 UTC
@RuinIsProbablyTaken There's no repo on my project. You want the source of that one, right click it and view. There's not much there. As I said here: :point_up: 30 januari 2018 01:23 it's based on Firepad.
And yes. Firepad happens to use OT.js for Operational Transformation
Just as TogetherJS does. And Google Docs does. And pretty much every other collaboration editor out there does
Henry
@GitHub-Henry
Jan 30 2018 02:08 UTC

@123xylem here's a start of a solution

const apiNum = 546798150000000000;
//            0.546798150000000000
var apiStr = "0." + String(apiNum);
console.log(apiStr);
var newApiNum = Number(apiStr);
console.log(newApiNum);

Chris Cullen
@123xylem
Jan 30 2018 02:10 UTC
@GitHub-Henry thanks.. My question had a typo though as the number given wasnt .5 it was 55653...
Your solution does work unless the number its give is actually more than 1
CamperBot
@camperbot
Jan 30 2018 02:10 UTC
123xylem sends brownie points to @github-henry :sparkles: :thumbsup: :sparkles:
swoonvin
@swoonvin
Jan 30 2018 02:22 UTC
@HeinousTugboat Thank you.
CamperBot
@camperbot
Jan 30 2018 02:22 UTC
swoonvin sends brownie points to @heinoustugboat :sparkles: :thumbsup: :sparkles:
Alexander Jarman
@HeinousTugboat
Jan 30 2018 02:37 UTC
Man, I friggin' love Angular. <3 <3
Angular 2+.. not AngularJS..
Claudio Restifo
@Marmiz
Jan 30 2018 04:25 UTC

guys I was messing around with async/await, someone is willing to give me a hand?

Mainly in relation to error catching.
I am thinking of wrapping it in a try/catch scenario...
is there a better way?

Also where should I handle my "success"?
so If i have a structure like:

async  mainFunction() {
try {
const a = await apiCall() // this is a promise
// should I handle success here? like doSomethingWith(a) ?
} catch(e) {
// do something with error
}

// or I should process the success outside the try/catch?
}

cheers :beer:

Alexander Jarman
@HeinousTugboat
Jan 30 2018 04:32 UTC
Wrapping async/await in try/catch is correct, I believe. :-)
let thing = somePromise()
.then(x => doSomething(x))
.catch(e => itBroke(e))
should be roughly the same as
try {
let thing = await somePromise();
doSomething(thing);
} catch(e) {
itBroke(e);
}
yangxia605
@yangxia605
Jan 30 2018 04:35 UTC
I am confused that why the last test not passed.I think I've already do it.
Alexander Jarman
@HeinousTugboat
Jan 30 2018 04:35 UTC
@yangxia605 I'm not super familiar with React or JSX, but it doesn't look like your submit handler's actually returning anything.
yangxia605
@yangxia605
Jan 30 2018 04:40 UTC
@HeinousTugboat submit handler changes the toDoList .that means push itemsArray into the toDoList.So that can be map into an ul element with some li inside of it.
Alexander Jarman
@HeinousTugboat
Jan 30 2018 04:40 UTC
Right, but if the test is looking for a return and is firing the handler by itself, it isn't going to see that change since it's looking for a return not a mutation.
I'm not sure how they mean "dynamically return" in this instance, though. I'll leave it to someone that knows the react curriculum better than I do.
Eric Miller
@ericmiller777
Jan 30 2018 07:01 UTC
What is it asking me to do exactly
i cant figure it out, looked into .assign
ive tryed most combination of this with/without status
return state.assign({}, state, action.type);
Manish Giri
@Manish-Giri
Jan 30 2018 07:06 UTC
return Object.assign({}, state, {/* your code here */ })
with Object.assign, you pass objects which contain the properties you want in your final object
Claudio Restifo
@Marmiz
Jan 30 2018 07:07 UTC
@ericmiller777 Object Assign
Manish Giri
@Manish-Giri
Jan 30 2018 07:07 UTC
@Marmiz :wave:
Claudio Restifo
@Marmiz
Jan 30 2018 07:07 UTC
@Manish-Giri :wavy_dash: all good?
Manish Giri
@Manish-Giri
Jan 30 2018 07:09 UTC
@Marmiz not really!
Claudio Restifo
@Marmiz
Jan 30 2018 07:09 UTC
That's a nice book.. I have a digital copy of it :)
Manish Giri
@Manish-Giri
Jan 30 2018 07:10 UTC
I don't read PDFs well so got a hold of this
Eric Miller
@ericmiller777
Jan 30 2018 07:11 UTC
@Manish-Giri @Marmiz thanks, ill keep trying
CamperBot
@camperbot
Jan 30 2018 07:11 UTC
ericmiller777 sends brownie points to @manish-giri and @marmiz :sparkles: :thumbsup: :sparkles:
:star2: 1138 | @marmiz |http://www.freecodecamp.org/marmiz
:star2: 6807 | @manish-giri |http://www.freecodecamp.org/manish-giri
Claudio Restifo
@Marmiz
Jan 30 2018 07:11 UTC
I think I have the digital from some humble bundle of some sort ^^
Manish Giri
@Manish-Giri
Jan 30 2018 07:13 UTC
I printed off YDKJS recently
Eric Miller
@ericmiller777
Jan 30 2018 07:13 UTC
@Manish-Giri i plan to read all of those soon
tm*
Manish Giri
@Manish-Giri
Jan 30 2018 07:13 UTC
cool
@Marmiz also need to finish this
Claudio Restifo
@Marmiz
Jan 30 2018 07:14 UTC

@ericmiller777 my 2c: instead of learning "to do stuff", learn a method "of learning".

For instance in this challenge they mention Object.assign.

If I've never heard of it --> look for official documentation about it.
I've heard but don't remember --> look on official docs
I'm not sure how it works --> open a repl and make some quick example to get an hang / visual aid.
finally try to implement the task

@Manish-Giri all I know about Java is some guy once told me is like C# but not really.
I think I've rated myself "confident in Java" on Linkedin :)
Manish Giri
@Manish-Giri
Jan 30 2018 07:16 UTC
lol
awesome
Eric Miller
@ericmiller777
Jan 30 2018 07:17 UTC
@Marmiz thanks, ive been trying to do that more, this one didnt seem to help much with twhat im trying to do (im sure its somthing simple i just need to understand it a bitt more)
CamperBot
@camperbot
Jan 30 2018 07:17 UTC
ericmiller777 sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
api offline
Claudio Restifo
@Marmiz
Jan 30 2018 07:17 UTC
@ericmiller777 Docs and prototype.
Then you implement
Manish Giri
@Manish-Giri
Jan 30 2018 07:17 UTC
@ericmiller777 this example from the doc should help
var o1 = { a: 1, b: 1, c: 1 };
var o2 = { b: 2, c: 2 };
var o3 = { c: 3 };

var obj = Object.assign({}, o1, o2, o3);
console.log(obj); // { a: 1, b: 2, c: 3 }
Claudio Restifo
@Marmiz
Jan 30 2018 07:18 UTC
indeed!
Manish Giri
@Manish-Giri
Jan 30 2018 07:18 UTC
see how the values of b and c are being overwritten
Eric Miller
@ericmiller777
Jan 30 2018 07:18 UTC
thank you guys
Manish Giri
@Manish-Giri
Jan 30 2018 07:19 UTC
later on you'll use ... on objects too, then you won't need .assign() anymore
lol
Eric Miller
@ericmiller777
Jan 30 2018 07:20 UTC
yea spread operator I understood a lot more (but probably just because i could just then pass arrays ect to javascript functions i really understood)
Claudio Restifo
@Marmiz
Jan 30 2018 07:22 UTC
well if you like spread this is the equivalent of @Manish-Giri example:
var o1 = { a: 1, b: 1, c: 1 };
var o2 = { b: 2, c: 2 };
var o3 = { c: 3 };

var obj = Object.assign({}, {...o1, ...o2, ...o3});
console.log(obj); // { a: 1, b: 2, c: 3 }
but it's way more obscure imho
Manish Giri
@Manish-Giri
Jan 30 2018 07:23 UTC
you could just do var obj = ({}, {...o1, ...o2, ...o3})
should work the same
Manish Giri
@Manish-Giri
Jan 30 2018 07:31 UTC

@Marmiz loved this little advice from the book

A useful principle is not to add cleverness unless you are absolutely sure
you’re going to need it. It can be tempting to write general “frameworks”
for every little bit of functionality you come across. Resist that urge. You
won’t get any real work done, and you’ll end up writing a lot of code
that no one will ever use.

for everyone who writes 10 lines of JS and publishes a library, shit.js, crap.js, etc
Claudio Restifo
@Marmiz
Jan 30 2018 07:34 UTC

@Manish-Giri just found myself in the same rabbit hole the past week.

We are working on a massive react application atm, and we are gonna have a lots of different forms across the page.
So I decided to abstract the functionality away in a general fashion so that I can reuse the same idea across the app.

tuned out I went so deep that the code was hardly readable anymore.

Leave refactoring for when it's needed... that was my lesson
Manish Giri
@Manish-Giri
Jan 30 2018 07:35 UTC
:+1:
Claudio Restifo
@Marmiz
Jan 30 2018 07:36 UTC
still one of the best library as of today:
https://github.com/aemkei/jsfuck
this rise in the tops too:
https://github.com/hkbakke/bash-insulter
Manish Giri
@Manish-Giri
Jan 30 2018 07:41 UTC
lol
Eric Miller
@ericmiller777
Jan 30 2018 08:17 UTC
return Object.assign({}, state, {status: action.type});
I would think that would make that status overwrite the status in state
how can i log state?
Manish Giri
@Manish-Giri
Jan 30 2018 08:20 UTC
the status needs to be "online"
you don't need to modify state as such
Eric Miller
@ericmiller777
Jan 30 2018 08:24 UTC
lol
@Manish-Giri @Marmiz tahnks, its aggravating it took me so long to get it, but I guess i learned a bit about how it works....
Manish Giri
@Manish-Giri
Jan 30 2018 08:25 UTC
:+1:
keep at it
YUE HU
Jan 30 2018 09:06 UTC
just began the class and got stuck in setting the font-size. Where should I put the font-size command?
Sorin Ruse
@sorinr
Jan 30 2018 09:11 UTC
YUE HU
Jan 30 2018 09:11 UTC
thanks!
Sorin Ruse
@sorinr
Jan 30 2018 09:12 UTC
:+1:
Eric Miller
@ericmiller777
Jan 30 2018 09:29 UTC
@Marmiz @Manish-Giri I was gonna link somthing in js(insert f word here), then noticed it was 30k chars lol
yangxia605
@yangxia605
Jan 30 2018 10:05 UTC
@HeinousTugboat anyhow thanks for your reply.I am also confused about ""dynamically return" ,so that not solve this problem at this time.
CamperBot
@camperbot
Jan 30 2018 10:05 UTC
yangxia605 sends brownie points to @heinoustugboat :sparkles: :thumbsup: :sparkles:
Yossi Fisch
@yoizfefisch
Jan 30 2018 10:48 UTC
Trying to work on the Technical Documentation Page in the beta curriculum and I am not sure where to begin. Should I just copy the HTML from some technical website and style it myself?
seemotions
@seemotions
Jan 30 2018 10:57 UTC
Currently working on Build a Tribute Page how can i change space between rows
and what should I do if i want to make a text from a paragraph to be in 2 diffrent lines
@ezioda004
Jan 30 2018 10:59 UTC
@seemotions To give space between two div you can use margin-top on the 2nd div
For the text to be in 2 different line you can use <br> tag
seemotions
@seemotions
Jan 30 2018 11:04 UTC
@ezioda004 Thanks dude!
CamperBot
@camperbot
Jan 30 2018 11:04 UTC
seemotions sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
Yossi Fisch
@yoizfefisch
Jan 30 2018 11:57 UTC
@seemotions To change space between rows in the same paragraph, you can use the CSS line-height property.
seemotions
@seemotions
Jan 30 2018 12:48 UTC
one more think how to make every line start from the same position
Bjorn van de Peut
@bjorno43
Jan 30 2018 13:56 UTC
@RuinIsProbablyTaken There's not much worthy of making a repo for. The source code you can see with the browser is all there is to it. Even a novice JS coder could do that, lol
ahmed-issa-mohd
@ahmed-issa-mohd
Jan 30 2018 13:57 UTC
can I have question , please?
Jan 30 2018 15:26 UTC
@ahmed-issa-mohd - do you want to ask a question? Post it here and everyone will try to help you.
Darren
@DarrenfJ
Jan 30 2018 15:56 UTC
morning fCC
@bjorno43 sorry brutha missed yer PM was offline last night.. will check it today
off to test and you know.. work
bah!
code on roomies!
Xavier Artot
@xavierartot
Jan 30 2018 18:04 UTC
Hi there
Darren
@DarrenfJ
Jan 30 2018 18:21 UTC
@xavierartot hi buddy! welcome to the helpRoom if you haven't already dropped by previously...
have a :coffee: on me ;)
Xavier Artot
@xavierartot
Jan 30 2018 18:42 UTC
thx
I cam last year and I back on FCC to finish the Visualisation
Darren
@DarrenfJ
Jan 30 2018 18:51 UTC
@xavierartot cool.. good luck on it and happy coding :D
LiteSoul
@LiteSoul
Jan 30 2018 19:44 UTC
Hi everyone... I'm wondering if the issue in the Beta FCC could be resolved: It was working fine until last week, now when you pass a test it stops there and you can't advance!
artbohr
@artbohr
Jan 30 2018 20:21 UTC
Does anyone have a good recommendation for a simple boilerplate which can be used for the dynamic projects (backend)?
Kyle Holm
@thekholm80
Jan 30 2018 20:23 UTC
@artbohr have you looked at clementine.js?
I think that's what FCC recommends
artbohr
@artbohr
Jan 30 2018 20:23 UTC
that's not useful for me, I think
I looked in to it
Kyle Holm
@thekholm80
Jan 30 2018 20:23 UTC
artbohr
@artbohr
Jan 30 2018 20:24 UTC
I mean't a kind of MERN boilerplate, with the minimum dependencies pack
Kyle Holm
@thekholm80
Jan 30 2018 20:25 UTC
I'd suggest making your own then - I assume you have node and npm installed? init a new project, install express, mongodb, react & all the stuff you normally use there then you can just clone it for each new project
artbohr
@artbohr
Jan 30 2018 20:25 UTC
ye, also thought that
but wanted to avoid webpack configurations for now, so I can proceed to the important stuff right away
Kyle Holm
@thekholm80
Jan 30 2018 20:26 UTC
use create-react-app for the front
artbohr
@artbohr
Jan 30 2018 20:26 UTC
but I guess the time I spent looking for boilerplate solutions, I could have learned all the important webpack stuff already
I tried mixing create-react-app with just an extra express install on it and a server.js file, but I failed to launch the node server.js, it's just stays on halt forever
Kyle Holm
@thekholm80
Jan 30 2018 20:27 UTC
the alpha webpack version is nearly zero config, I can't wait for it to make it live
but stumbled in to the problem I stated above

Step 6: Start the express server

node server.js

does nothing for me

Kyle Holm
@thekholm80
Jan 30 2018 20:30 UTC
hmm, i'll have to give that a try
artbohr
@artbohr
Jan 30 2018 20:32 UTC
will try it again now
maybe I did something wrong the last time
this combo seems pretty simple and convenient for me
Kyle Holm
@thekholm80
Jan 30 2018 20:33 UTC
i'm installing right now, i'll let you know how it turns out for me
Sweet Coding :)
@SweetCodingInc
Jan 30 2018 20:33 UTC
@artbohr are have you done .listen on express server?
happysoccerboy
@happysoccerboy
Jan 30 2018 20:36 UTC
artbohr
@artbohr
Jan 30 2018 20:36 UTC
@SweetCodingInc after executing node server.js, it just stays on halt
happysoccerboy
@happysoccerboy
Jan 30 2018 20:37 UTC
i am working on the search and replace project, not sure why the replace doesn't work, can someone help provide guidance? thx
artbohr
@artbohr
Jan 30 2018 20:37 UTC
it stays like that
Sweet Coding :)
@SweetCodingInc
Jan 30 2018 20:38 UTC
@artbohr yes
that's an expected behavior
you have this like
app.listen(process.env.PORT || 8080);
artbohr
@artbohr
Jan 30 2018 20:39 UTC
@SweetCodingInc ye
Sweet Coding :)
@SweetCodingInc
Jan 30 2018 20:39 UTC
try doing
app.listen(process.env.PORT || 8080, () => {
console.log('Server Started');
});
and see if you get that log
you have not specified the callback function for .listen so you don't get notified when the server is up
Kyle Holm
@thekholm80
Jan 30 2018 20:40 UTC
also, it looks like create-react-app outputs to public not build unless my install is old
other than that, it's all working for me
you'll have to enable CORS in development since your front end will run on port 3000 and your back end will be on port 8080
artbohr
@artbohr
Jan 30 2018 20:41 UTC
@SweetCodingInc damn, I'm retarded, thanks :D the server launches
CamperBot
@camperbot
Jan 30 2018 20:41 UTC
artbohr sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
Sweet Coding :)
@SweetCodingInc
Jan 30 2018 20:42 UTC
@artbohr :+1:
artbohr
@artbohr
Jan 30 2018 20:42 UTC
@thekholm80 hmm, ye, the server works, just gotta configure them to behave with each other
Sweet Coding :)
@SweetCodingInc
Jan 30 2018 20:42 UTC
@artbohr You won't need much configuration like @thekholm80
artbohr
@artbohr
Jan 30 2018 20:42 UTC
Error: ENOENT: no such file or directory, stat 'C:\Users\user\Desktop\example\test-app\build\index.html'
at Error (native)
Sweet Coding :)
@SweetCodingInc
Jan 30 2018 20:42 UTC
just add a CORS middleware for express
artbohr
@artbohr
Jan 30 2018 20:43 UTC
gotta configute that
ok
Sweet Coding :)
@SweetCodingInc
Jan 30 2018 20:43 UTC
are you developing your backend as a REST server or does it serve your initial index.html file?
artbohr
@artbohr
Jan 30 2018 20:44 UTC
I'm doing the voting app project
so it has to have an api where I can send the requests as I understand it
Kyle Holm
@thekholm80
Jan 30 2018 20:45 UTC
you will build the api
in express
artbohr
@artbohr
Jan 30 2018 20:46 UTC
yea, got a bit the grasp of that this past days, trying to figure out how to unite them
but I feel kinda lost and not fully understanding all the concepts
as I understand I will send requests to the backend API from the frontend API which will perform DB operations
Kyle Holm
@thekholm80
Jan 30 2018 20:47 UTC
right
artbohr
@artbohr
Jan 30 2018 20:47 UTC
not frontend API sorry
just frontend
Kyle Holm
@thekholm80
Jan 30 2018 20:48 UTC
user does something => front makes api call to back => back does magic => sends api results to front => page updates => user does something ... (repeat)
artbohr
@artbohr
Jan 30 2018 20:49 UTC
ye, now I gotta apply all this with the practice to get the real grasp of it
Kyle Holm
@thekholm80
Jan 30 2018 20:49 UTC
yep
just a suggestion, look at nodemon (npm install -g nodemon) it will let you hot-reload your server by running nodemon server.js instead of node server.js
it's pretty awesome
artbohr
@artbohr
Jan 30 2018 20:50 UTC
ye I know what nodemon is, will install it in a moment, thanks @thekholm80
CamperBot
@camperbot
Jan 30 2018 20:50 UTC
artbohr sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1679 | @thekholm80 |http://www.freecodecamp.org/thekholm80
artbohr
@artbohr
Jan 30 2018 20:52 UTC
btw, the CORS is because the backend and frontend runs in different ports, right?
Kyle Holm
@thekholm80
Jan 30 2018 20:52 UTC
yes
you can remove it in production
artbohr
@artbohr
Jan 30 2018 20:53 UTC
kinda confused with this last part thing from the tutorial

Conclusion

Now you can develop all you want on localhost:3000 by using npm run start and your API's will work as expected (despite requests coming from port 3000).

When you want to deploy, just run the production build npm run build and serve your app from localhost:8080, which is node server.js in this example (note the port number at the bottom of server.js).

you mean removing cors in production?
because the will unite?
they*
Kyle Holm
@thekholm80
Jan 30 2018 20:53 UTC
yes
you will serve the bundled version of your app in production from the public folder instead of running webpack
that's what the app.get('/', (req, res) => {}) bit in your server.js does
artbohr
@artbohr
Jan 30 2018 20:56 UTC
as I understood the "/" does handle requests to your root url, or am I missing something here?
Kyle Holm
@thekholm80
Jan 30 2018 20:56 UTC
yes, / is the main path
so if i were google, any request to http://google.com would come from that / path
artbohr
@artbohr
Jan 30 2018 20:57 UTC
ye
I feel pretty confused on what changes and how the deployment works, if I want to upload it to heroku for example
what changes from dev version to production version I mean, or bundle for deployment, or how that is called
Kyle Holm
@thekholm80
Jan 30 2018 20:58 UTC
when you get done building your front end you'll run npm build or something like that, it will bundle your front end up and put the output into the public folder
then when your server is running, any requests to your root path will serve that bundle
artbohr
@artbohr
Jan 30 2018 21:00 UTC
so the frontend does not run in a different port after is bundles, it just acts as an asset so to say which is rendered from the requests to the server
bundled*
Kyle Holm
@thekholm80
Jan 30 2018 21:00 UTC
correct
artbohr
@artbohr
Jan 30 2018 21:01 UTC
that's a good explanation thanks again, can't give brownies yet tho :worried: ^^
Kyle Holm
@thekholm80
Jan 30 2018 21:01 UTC
:smile: happy to help
artbohr
@artbohr
Jan 30 2018 21:04 UTC
still kinda confused about the heroku part once I'm done with the development
gone through their nodejs app tutorial deployment, but I guess this fullstack app will be quite different
found some tutorials, but can't understand the gist of how it works
Kyle Holm
@thekholm80
Jan 30 2018 21:07 UTC
it was the same for me as the microservices
I just didn't push my react dev files to heroku when it came time to deploy
if you do the same, remember that any assets you need in production should be in the public directory
Darren
@DarrenfJ
Jan 30 2018 21:10 UTC
@artbohr I'll give him brownie points ;)
thanks @thekholm80 my bearded brutha for your tireless helping of the out
CamperBot
@camperbot
Jan 30 2018 21:10 UTC
:star2: 1680 | @thekholm80 |http://www.freecodecamp.org/thekholm80
darrenfj sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
Garrus Napp
@GarrusNapp
Jan 30 2018 21:10 UTC
@DarrenfJ just dont get banned ; )
Darren
@DarrenfJ
Jan 30 2018 21:10 UTC
i'm allowed on thank you per page scroll ;)
or 15 minutes :P
Kyle Holm
@thekholm80
Jan 30 2018 21:11 UTC
@DarrenfJ hey thanks man! happy to hold the fort down while you're working for the man
CamperBot
@camperbot
Jan 30 2018 21:11 UTC
thekholm80 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2367 | @darrenfj |http://www.freecodecamp.org/darrenfj
Manish Giri
@Manish-Giri
Jan 30 2018 21:14 UTC
@DarrenfJ @GarrusNapp @thekholm80 :wave:
Garrus Napp
@GarrusNapp
Jan 30 2018 21:15 UTC
@Manish-Giri yoyo
Kyle Holm
@thekholm80
Jan 30 2018 21:15 UTC
@Manish-Giri hola che
Manish Giri
@Manish-Giri
Jan 30 2018 21:15 UTC
@GarrusNapp still alive and kicking I see!
I was thinking you or me would get banned pretty soon (considering how things were)
lol
Garrus Napp
@GarrusNapp
Jan 30 2018 21:16 UTC
well :D
im still alive, only react can kill me now
and it slowly starts to
Manish Giri
@Manish-Giri
Jan 30 2018 21:16 UTC
in my case, it's angular
and servlets
and spring
Garrus Napp
@GarrusNapp
Jan 30 2018 21:18 UTC
i'm at the point where if I just try to sit and code without planning it before, I'll mess up for sure :D
it's not jQuery anymore :D
Kyle Holm
@thekholm80
Jan 30 2018 21:18 UTC
lol
Manish Giri
@Manish-Giri
Jan 30 2018 21:18 UTC
I miss jQuery
Kyle Holm
@thekholm80
Jan 30 2018 21:19 UTC
i love writing react code, but i hate the react ecosystem
webpack, babel, etc ... such a pain
Manish Giri
@Manish-Giri
Jan 30 2018 21:19 UTC
you should switch to angular
and then teach me
Kyle Holm
@thekholm80
Jan 30 2018 21:19 UTC
angular 1?
deal
Manish Giri
@Manish-Giri
Jan 30 2018 21:19 UTC
2
4
5
Kyle Holm
@thekholm80
Jan 30 2018 21:19 UTC
nope, 1 or nothing
Garrus Napp
@GarrusNapp
Jan 30 2018 21:19 UTC
I'm just using create-react-app idgaf xD
Manish Giri
@Manish-Giri
Jan 30 2018 21:19 UTC
1 is easy
Kyle Holm
@thekholm80
Jan 30 2018 21:20 UTC
create-react-app had way too much stuff i didn't need
Manish Giri
@Manish-Giri
Jan 30 2018 21:20 UTC
I had to install yarn yest
just coz create-react-app ditched npm
Garrus Napp
@GarrusNapp
Jan 30 2018 21:20 UTC
did they?
Manish Giri
@Manish-Giri
Jan 30 2018 21:20 UTC
yup
Garrus Napp
@GarrusNapp
Jan 30 2018 21:20 UTC
ffs
IF YOURE NOT RUNNING YOURE GOING BACKWARDS
Manish Giri
@Manish-Giri
Jan 30 2018 21:21 UTC
speaking of running, I should prolly go to the gym
Garrus Napp
@GarrusNapp
Jan 30 2018 21:21 UTC
lift them weights
Manish Giri
@Manish-Giri
Jan 30 2018 21:21 UTC
sitting and coding won't do you any good in real life
if u kno what I mean
Kyle Holm
@thekholm80
Jan 30 2018 21:22 UTC
there are hot singles in my area who want to meet me, I don't need the gym
Garrus Napp
@GarrusNapp
Jan 30 2018 21:22 UTC
well, it makes your wallet bigger in a long run
@Manish-Giri you lift or just run?
Manish Giri
@Manish-Giri
Jan 30 2018 21:24 UTC
atm I run
will go back to lifting in a month
Garrus Napp
@GarrusNapp
Jan 30 2018 21:25 UTC
i started 'stronglifts 5x5 ' recently
Manish Giri
@Manish-Giri
Jan 30 2018 21:25 UTC
cool
Garrus Napp
@GarrusNapp
Jan 30 2018 21:25 UTC
good stuff but linear progression is going to kill me
Manish Giri
@Manish-Giri
Jan 30 2018 21:27 UTC
what doesn't kill you only makes you stronger
Garrus Napp
@GarrusNapp
Jan 30 2018 21:28 UTC
or it'll just send me back to procastrination mode
when you struggle but make it, it feels good. but then you remember that next time you have to lift more
LiteSoul
@LiteSoul
Jan 30 2018 21:28 UTC
I just add weights every other week instead of every week, regarding 5x5
Garrus Napp
@GarrusNapp
Jan 30 2018 21:31 UTC
the one I use increases by 2.5kg each training
starting from just bar tho
LiteSoul
@LiteSoul
Jan 30 2018 21:34 UTC
yeah but I couldn't keep adding that much after a while
Garrus Napp
@GarrusNapp
Jan 30 2018 21:36 UTC
Yea I think you're bound to plateau after a certain point but for now I lift baby weights so I'm good
Darren
@DarrenfJ
Jan 30 2018 21:42 UTC
@thekholm80 i am most definitely a cog in theeee man's wheels
@Manish-Giri buddy! :wave:
Darren
@DarrenfJ
Jan 30 2018 21:49 UTC
also, not that any of you guys need it.. but anyone new who wants to practice git/github: https://forum.freecodecamp.org/t/git-and-github-practice-for-all-us-noobies/171808
feel free to share
DarrenfJ @DarrenfJ sneaks back under his bridge to whip up some unsolvable puzzles for weary travelers
Stephen James
@sjames1958gm
Jan 30 2018 23:10 UTC
@DarrenfJ I knew you were a bridge troll!
CamperBot
@camperbot
Jan 30 2018 23:10 UTC
:trollface: troll problems? notify admins here