I see that MERN Starter project is using Express on the backend. I am planning to use Sails.js Web Framework and was wondering what all things are required to integrate it well with MERN Stack.
Any idea or experience?
We've used express in mern.io, as it is, arguably, the easiest way to get started with NodeJS development.
Just as ExpressJS wraps around basic HTTP libraries provided by NodeJS, to enable you to manage things like routing, sessions, etc... in an easy way; SailsJS wraps around ExpressJS to provide you an abstraction level higher — giving you an ORM to work with a wide gamut of NoSQL, and SQL databases, real-time functionalities, auto- generation of REST APIs, and other fancy stuff.
The way we've structured the mern.io boilerplate, you would have to do a complete re-write of server setup, and database handling — we use mongoose as the ORM.
Propbably @somu can expand on this answer.
Somasundaram Ayyappan
Apart from the API routes, we use express middleware for Server Side Rendering of react components. You can find the code here.
As @saiki explained, SailsJs is a wrapper around the express js. As I understood from SailsJs documentation, you can still use express middlewares in SailsJs. You just have to put the above mentioned code in
sails.config.http.middlewarefile. If you run into any issues doing that, let me know.