These are chat archives for CodeHubOrg/discussions

9th
Feb 2017
Tim Handy
@TimHandy
Feb 09 2017 15:58
@rinse0ut Hey Dave... question for you... I've built an API for a project with Express... all the endpoints are working nicely responding to routes and spitting back JSON. I now need to do the front end with React... which is fine on it's own... I use webpack-dev-server and everything is good. Only now, this is the first time I've attempted to shove the front end onto the backend and I don't get how to run the servers in development? First of all nodemon (running so the backend can respond to requests) seems to have been hijacked by Webpack, so I changed to running some random command in package.json scripts which seems to have fixed that. Now attempting to install some Bootstrap. I put the Boostrap CSS files in public to be served by Express, but webpack can't see them because it's running on port 8080... it's all a bit confusing... any words of wisdom on what to Google to understand this please? The whole running two webservers is confusing me. Am I doing it all wrong?
Dave Thomson
@rinse0ut
Feb 09 2017 16:05
Funnily enough I am doing exactly the same thing for work at the moment.
Tim Handy
@TimHandy
Feb 09 2017 16:06
haha, you're the man to speak to then!
Dave Thomson
@rinse0ut
Feb 09 2017 16:06
Can you configure the ports?
I’ve not used it yet, but this should be helpful:
Tim Handy
@TimHandy
Feb 09 2017 16:07
probably... in dev am I supposed to be running nodemon for my backend Express on port 3000, and also webpack-dev-server for my front-end React?
Dave Thomson
@rinse0ut
Feb 09 2017 16:07
At the moment I have my client running on localhost 8080 and the api server on 3000
Tim Handy
@TimHandy
Feb 09 2017 16:08
yes, that's what i'm doing
so I'm on the right lines then
what are you running your 8080 server with?
Dave Thomson
@rinse0ut
Feb 09 2017 16:08
webpack
Tim Handy
@TimHandy
Feb 09 2017 16:08
and what are you running your api server with
Dave Thomson
@rinse0ut
Feb 09 2017 16:08
express
Tim Handy
@TimHandy
Feb 09 2017 16:09
via nodemon? or just node
Dave Thomson
@rinse0ut
Feb 09 2017 16:09
first mocked it with json-server
just node
Tim Handy
@TimHandy
Feb 09 2017 16:09
ok, maybe that's what i'm doing wrong
i'm attempting to use nodemon
as i did in dev for it
Dave Thomson
@rinse0ut
Feb 09 2017 16:10
If your running it over a network 0.0.0.0 instead of localhost is useful
You might get an error on the client
I used the core package fix
Tim Handy
@TimHandy
Feb 09 2017 16:11
ooh, ok, i'll have a read of that. thanks. i'll have a look at json-server and hotel also... cheers.
Dave Thomson
@rinse0ut
Feb 09 2017 16:31
Do we have a place to share resources?
Tim Handy
@TimHandy
Feb 09 2017 16:33
the dropbox dir i think
Dave Thomson
@rinse0ut
Feb 09 2017 16:33
would be good to have google drive doc to share or something
Tim Handy
@TimHandy
Feb 09 2017 16:34
what kind of things?
Dave Thomson
@rinse0ut
Feb 09 2017 16:34
Useful packages eg hotel and other latest tech and blog posts
Dave Thomson
@rinse0ut
Feb 09 2017 17:29
Did you get access / have any thoughts?
Tim Handy
@TimHandy
Feb 09 2017 17:31
just finished 8 hrs of pair coding... going to have a coffee and start reading your links... i'll report back!
Dave Thomson
@rinse0ut
Feb 09 2017 17:32
Right on Jon!
Dave Thomson
@rinse0ut
Feb 09 2017 17:48
Please add any cool new shiney resources / useful ones!
Tim Handy
@TimHandy
Feb 09 2017 18:37
ok..
@rinse0ut Are you using Bootstrap with React, and if so, are you using React-Bootstrap or other?
@rinse0ut: Authentication... PassportJS? or easier (read noob) method to use?
Dave Thomson
@rinse0ut
Feb 09 2017 20:04
@TimHandy Yes, I have just been importing it (you have to config web pack loaders). We are using an off the shelf bootstrap admin which I am going to rewrite to reduce the bloat.
Tim Handy
@TimHandy
Feb 09 2017 20:04
yeah, i'd seen that... a shit load of loaders!
ok, so no react-bootstrap then.
Dave Thomson
@rinse0ut
Feb 09 2017 20:05
@TimHandy Passport JS seems to be the way to go (I’ve not looked into it in much depth tho). I expect you could roll something yourself, but it would be easier to just use passport
Tim Handy
@TimHandy
Feb 09 2017 20:05
roll something myself! are you kidding! :P
Dave Thomson
@rinse0ut
Feb 09 2017 20:06
Yes no bootstrap. I would like to just include the bootstrap modules that are needed to reduce the bloat. Perhaps use the sass.
Hey why not!
Tim Handy
@TimHandy
Feb 09 2017 20:07
I think I might somehow have over-sold you on my skills somewhere along the line! :-)
Dave Thomson
@rinse0ut
Feb 09 2017 20:08
I’ve got to finish my work for the end of play tomorrow. Just set up the project from scratch, with a table of bookings that is filterable and sortable using Ramda and an api server. Loads of shit todo, but am learning alot about performance, dbs etc
Tim Handy
@TimHandy
Feb 09 2017 20:08
cool!
Dave Thomson
@rinse0ut
Feb 09 2017 20:08
It’s worth giving it a go, even if it doesn’t work at least you will have learnt something and that’s the most important thing.
It’s gonna be challenging!
@TimHandy try the tutorial above
this one looks really good
Dave Thomson
@rinse0ut
Feb 09 2017 20:12
nice
btw I’ve been playing about with Docker. It’s sweet, you can get a minimal node server (container) running on your machine using only 18mb compared to a virtual machine that could be > 1GB
Tim Handy
@TimHandy
Feb 09 2017 20:14
Was going to speak to you about docker at some point... it's on my fun-things to look at list.
Dave Thomson
@rinse0ut
Feb 09 2017 20:15
That means you can set up an environment for development and give it to a friend who can run it with one command or deploy to a server using one command
Tim Handy
@TimHandy
Feb 09 2017 20:15
smells like the future!
Dave Thomson
@rinse0ut
Feb 09 2017 20:15
I’ve got a digital ocean server for 5 bucks a month and will try it out.
Yeah man! I’ve got to crack on. I’ll let you know if I find anything useful for the server set up.
Tim Handy
@TimHandy
Feb 09 2017 20:16
hokay!
Tim Handy
@TimHandy
Feb 09 2017 20:34
...ahh. cors... yes, used a dirty chrome extension to get around that one today... this cors npm package looks better.
Katja Durrani
@katjad
Feb 09 2017 20:38
Wow you wrote so much! And most things I know nothing about. Feel kind of behing ;) - Hey we have $100 credit from Digital Ocean by the way! I asked them once, but maybe forgot to tell you. @rinse0ut @TimHandy
Tim Handy
@TimHandy
Feb 09 2017 20:40
nice... we could have a play with it i suppose! they have good docs on digital ocean.
Katja Durrani
@katjad
Feb 09 2017 20:43
yes they have good docs. I need to do more coding again I realise!
@rinse0ut have invited you to Digital Ocean team @TimHandy Do I have email for you? I must have but can't find it at the moment
Tim Handy
@TimHandy
Feb 09 2017 20:48
cheers.
I'm knackered. Coffee has all worn off.
Katja Durrani
@katjad
Feb 09 2017 20:49
It looks like you've been online all day! :)
We are eating now, so I am going too now. Have invited you both now, not sure if that automatically gives access, we'll see!