生产中的 Swagger Sails JS
Swagger Sails JS in production
我只想在开发环境中使用 swagger,但我想禁用此 link 或在生产环境中部署时禁用 swagger。我该怎么做?
检查 NPM 文档进行安装
"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."
仅为开发人员安装包:-
npm install swagger --only=dev
我只想在开发环境中使用 swagger,但我想禁用此 link 或在生产环境中部署时禁用 swagger。我该怎么做?
检查 NPM 文档进行安装
"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."
仅为开发人员安装包:-
npm install swagger --only=dev