I have 2 apps I am looking to add to my profile website which itself is an express app.
I want to run these apps under a /projects
route such that we can have localhost/projects/app1
and localhost/projects/app2
I want all the sub routes for each app to be handled at their respective routes
e.g the route /projects/app1/signup
redirects after a successful POST
to the dashboard but now i need to make sure this does not redirect to localhost/dashboard
but instead localhost/projects/app1/dashboard
I am aware of routing and I ams also using it on App1 i.e
var rank = require('./routes/ranks');
...
var taxiRanks = new rank();
...
app.get('/',taxiRanks.findNearbyRanks);
app.get('/whereami',taxiRanks.getCurrentLocation )
app.post('/location',taxiRanks.receiveLocation)
app.post('/signup',taxiRanks.newUser)
I WANT TO ACHIEVE SOMETHING LIKE THIS
...
var main_app = express()
var app1 = require('./path/to/app1')
var app2 = require('./path/to/app2')
...
main_app.get('/projects/app1' , app1())
main_app.get('/projects/app2' , app2())