d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Reactjs Questions Concerning Routes
Add Reply New Topic New Poll
Member
Posts: 4,351
Joined: Mar 11 2017
Gold: 0.00
Apr 26 2017 05:31pm
I'm trying to decide how/where to put my routes logic.

I have two main folders:
- Server
- Client

My Server folder contains all Models/Controllers/Database/Tests files.
My Client folder contains all React/html/css/babel/webpack files.

I'm not sure how/where to implement my routes files. Since I may be going Redux with React, where would be the best place to put my routes files?
Member
Posts: 5,167
Joined: Nov 23 2006
Gold: 11.01
Apr 26 2017 05:36pm
Quote (essxivxx @ Apr 26 2017 06:31pm)
I'm trying to decide how/where to put my routes logic.

I have two main folders:
- Server
- Client

My Server folder contains all Models/Controllers/Database/Tests files.
My Client folder contains all React/html/css/babel/webpack files.

I'm not sure how/where to implement my routes files. Since I may be going Redux with React, where would be the best place to put my routes files?


I'm not that familiar with RJS, but I assume you're using the node module react-router? I'd include any of that on the client side wherever your config files are kept.
Member
Posts: 4,351
Joined: Mar 11 2017
Gold: 0.00
Apr 26 2017 07:18pm
Quote (PuppyMonkeyBaby @ Apr 26 2017 03:36pm)
I'm not that familiar with RJS, but I assume you're using the node module react-router? I'd include any of that on the client side wherever your config files are kept.


I'm having trouble even connecting my Client with my Server. I'm not totally sure how to do this in Nodejs..

Also, i'm trying to create as much vanilla node as possible. It's for learning purposes, so i'll be writing my own routes, which will be from the Server folder.
Member
Posts: 3,476
Joined: Jul 20 2015
Gold: 651.00
Apr 27 2017 09:50pm
i like to use express for routing in node
Member
Posts: 5,167
Joined: Nov 23 2006
Gold: 11.01
Apr 28 2017 10:13am
Quote (essxivxx @ Apr 26 2017 08:18pm)
I'm having trouble even connecting my Client with my Server. I'm not totally sure how to do this in Nodejs..

Also, i'm trying to create as much vanilla node as possible. It's for learning purposes, so i'll be writing my own routes, which will be from the Server folder.


I would assume RJS has some sort of request service. With angular I use their native $http service to POST to my PHP middle layer.
Member
Posts: 4,351
Joined: Mar 11 2017
Gold: 0.00
Apr 28 2017 01:18pm
Quote (PuppyMonkeyBaby @ Apr 28 2017 08:13am)
I would assume RJS has some sort of request service. With angular I use their native $http service to POST to my PHP middle layer.


I usually go with Axios.

Quote (spt @ Apr 27 2017 07:50pm)
i like to use express for routing in node


That's what i'm using.
Member
Posts: 1,039
Joined: Jul 8 2008
Gold: 1,939.50
Apr 30 2017 07:31pm
Quote (PuppyMonkeyBaby @ Apr 28 2017 11:13am)
I would assume RJS has some sort of request service. With angular I use their native $http service to POST to my PHP middle layer.


Angular is a framework and react.js is a library/component so not it doesn't include that functionality. XHR or Jquery would work in conjunction with react.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll