Swagger Sails JS in production

275 Views Asked by At

I want to only have swagger in development environment but I want to disable this link or disable swagger when deploy on production. How can I do it?

1

There are 1 best solutions below

1
On BEST ANSWER

Check the NPM docs for install

"With the --production flag (or when the NODE_ENV environment variable is set to production), npm will not install modules listed in devDependencies."

"The --only={prod[uction]|dev[elopment]} argument will cause either only devDependencies or only non-devDependencies to be installed regardless of the NODE_ENV."

to install package for dev only :-

npm install swagger --only=dev