1

I'm trying to create a solution with FeathersJS and deploying it to AWS lambda function using serverless framework.

I used feathers generate app to create my application and choose sequelize as ORM to my application then, i tried running the app locally and then hit POST /users to register a new user and everything worked just as expected.

However, when I removed the users resource from the database then added serverless configuration and tried serverless-offline i always receive this error

{
    "name": "GeneralError",
    "message": "relation \"users\" does not exist",
    "code": 500,
    "className": "general-error",
    "errors": {}
}

So, I added some console logs to trace the issue and appeared that the Sequelize configuration file run for the first time with empty model object and this is the same behaviour as the normal local run. But, the local running - without using serverless - the configuration file called two times. One time with empty models object and the second time with

{
    users: users
}

Currently, I can't find the cause of missing this second time - the one responsible to create the users resource in the database.

Here is the approach that i used to handle the serverless configs

const serverless = require('serverless-http');

// This is the last line in the app.js file
module.exports.handler = serverless(app);

Hint: I also tried feathersjs/serverless but with no luck.

Thanks!

1 Answer 1

1

This is the trouble that comes with the feathersjs.

Please use this npm package to explore this possibility

https://www.npmjs.com/package/feathersjs-serverless

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.