dchester / epilogue

Create flexible REST endpoints and controllers from Sequelize models in your Express app
846 stars 116 forks source link

Fix check of restify vs express #222

Open ClementParis016 opened 6 years ago

ClementParis016 commented 6 years ago

Restify's createServer method allows a name option to customize the server name.

If it's value is changed from "restify", the following check would think it's running under Express: https://github.com/dchester/epilogue/blob/d46def3dfc7b9dd7b25303b124bb337499cc9f1f/lib/Controllers/base.js#L73-L74

And then the server would crash because app.delete is not a function in Restify.

This PR takes a safer approach by simply checking if app.delete is undefined.

tommybananas commented 6 years ago

Hello, please consider contributing this change to finale, a sequelize 4.x fork of epilogue