2

I would like to use Sails within a larger express based app. Most node.js MVC frameworks I have worked with you can mount as express middleware. Is this possible with Sails?

I want to do something like:

var express = require('express'),
  app = express();

var mySailsApp = require('./mysailsapp');

app.use(mySailsApp);
sgress454
  • 24,870
  • 4
  • 74
  • 92
Simon
  • 5,158
  • 8
  • 43
  • 65

1 Answers1

2

While there are some active efforts to develop systems that would let Sails be more modularized, there's no way to use a Sails app as Express middleware. Sails works on top of Express, but not the other way around. However, you can use custom Express middleware with Sails--see this answer for an example.

Community
  • 1
  • 1
sgress454
  • 24,870
  • 4
  • 74
  • 92