Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Removing services with the CLI #45

Closed
jmarlow4 opened this issue Oct 1, 2016 · 5 comments
Closed

Removing services with the CLI #45

jmarlow4 opened this issue Oct 1, 2016 · 5 comments

Comments

@jmarlow4
Copy link

jmarlow4 commented Oct 1, 2016

I was wondering if this feature was already implemented. I can't find anything online about it. If so, what's the command? If there is no command, what would be the safest way to remove a service?

@daffl
Copy link
Member

daffl commented Oct 1, 2016

There is not a lot of magic to how services are registered. To remove a generated service you can delete the src/services/<servicename> and test/services/<servicename> folders and then update src/services/index.js taking out the require and app.configure statement for that service.

@daffl daffl closed this as completed Oct 3, 2016
@emeagenciadigital
Copy link

it will be nice to have a CLI way of doing it.

@marshallswain
Copy link
Member

@emeagenciadigital the core team will not be working on this feature, but we are open to tested PRs. ;)

@EvanGeminika
Copy link

CMIIW, I think we also have to delete /src/model/.model.js

@SaabirMohamed
Copy link

SaabirMohamed commented Oct 29, 2020

due to lazyness ...
for now , I just do this with a script (pass the name of the service as the argument)


#!/bin/bash
cat src/services/index.js | grep -v "$1" > src/services/index.js
rm -rf src/services/$1
rm src/models/$1.model.js
rm test/services/$1.test.js


I put the above 4 lines in a bash script and run ./removeService service-I-spelt-wrong [enter]
this just works based on the elegant way in which services are generated in the 1st place. they become so easy to remove

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants