Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SailsJS: Undo API Generation & Clean, Safe Remove for API

I'm looking to remove/delete an API I generated using sails generate api

I had run sails generate api user and went onto implementing the sails-generate-auth plugin (tried sails-auth too), and the library said it something already exists in my /models directory. I deleted user from models, ran the plugin's command again, and it gave the same message for my /services directory -- but there are no files in that directory (except for .gitkeep)!

I would like to run a sails command, something like sails remove api user, to repeal anything configured for this endpoint -- and essentially start over (this time using sails-generate-auth).

How can I repeal an "api"?

like image 906
Cody Avatar asked Jul 04 '26 06:07

Cody


1 Answers

There is no command for deleting an API. You can remove your API by deleting your controller + model of the API.

When you run the command sails-generate-auth it automaticly creates a new User API.It returns an error whenever you need to delete anything else so you'll need to delete the files that it requested and the files that it just created...

You also might wanna check out this guide as it might help you alot with the proccess of implement OAuth authentication to your sails app: https://www.bearfruit.org/2014/07/21/tutorial-easy-authentication-for-sails-js-apps/

like image 114
Matan Gubkin Avatar answered Jul 05 '26 21:07

Matan Gubkin