I am developing a web application using Sails and React. My main purpose for using sails is to use the MVC pattern, and React to view views. Since Sails provides its own routing, but I want to use my React router.
For example: in the response router NotFoundRoute , so when I access a page that is not there, it should show me the handler that I defined for NotFoundRoute . Instead, he shows me sails of 404 pages.
So, how do I get control of the sail route when I want to use the React route?
React Routes
var JSX = require('babel/register'), React = require('react'), Router = require('react-router'), DefaultRoute = Router.DefaultRoute, NotFoundRoute = Router.NotFoundRoute, Route = Router.Route; var routes = ( <Route name="splash" path="/" handler={require('../main')}> <DefaultRoute handler={require('../components/Signup/signup')} /> <Route name="signup" path="/user/signup" handler={require('../components/Signup/signup')} /> <Route name="home" path="/user/home/:id" handler={require('../components/Home/home')} /> <NotFoundRoute handler={require('../components/commons/notFound')} /> </Route> ); module.exports = routes;
Sails Routes
module.exports.routes = { '/': { view: 'homepage' }, '/user/home/:id' : 'UserController.home' };
I am completely unfamiliar with these platforms and cannot find enough resources on the Internet. Sorry this stupid question.
source share