dougmoscrop / serverless-http

Use your existing middleware framework (e.g. Express, Koa) in AWS Lambda 🎉
Other
1.72k stars 166 forks source link

Working with SailsJS? #58

Closed anuraagdjain closed 5 years ago

anuraagdjain commented 5 years ago

How can we set this up with SailsJS. Following is my app.js file

var sails = sails = require('sails');
var rc = require('sails/accessible/rc');
const sls = require('serverless-http');

// Start server
sails.lift(rc('sails'));
module.exports.server =  sls(sails);

Throws the following error

{"errorMessage":"Error while loading app","errorType":"Error","stackTrace":["Error: serverless-http only supports koa, express/connect or a generic http listener","at getHandler (/Volumes/SailsApp/node_modules/serverless-http/lib/get-handler.js:16:9)","at module.exports
dougmoscrop commented 5 years ago

I'll see what I can get working. Are you using sails v1?

anuraagdjain commented 5 years ago

Yes, I'm on sails v1.0. Thanks

dougmoscrop commented 5 years ago

Ok I think I have something working. Will release soon.

On Sat, Oct 20, 2018, 1:41 PM Anuraag D Jain notifications@github.com wrote:

Yes, I'm on sails v1.0. Thanks

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/dougmoscrop/serverless-http/issues/58#issuecomment-431603264, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjzFBFdkEQ7piajGumW7fT05dKpvKhvks5um2A1gaJpZM4XxvWu .

dougmoscrop commented 5 years ago

Can you try with 1.7.0?

anuraagdjain commented 5 years ago

Will check and update this thread.

dougmoscrop commented 5 years ago

Gonna close this from inactivity, but if there's any issues please reopen!