@feathersjs/commons
Advanced tools
Comparing version 1.1.0 to 1.2.0
# Change Log | ||
## [v1.1.0](https://github.com/feathersjs/commons/tree/v1.1.0) (2017-10-23) | ||
[Full Changelog](https://github.com/feathersjs/commons/compare/v1.0.0...v1.1.0) | ||
**Merged pull requests:** | ||
- Remove unused utilities and add some inline documentation [\#59](https://github.com/feathersjs/commons/pull/59) ([daffl](https://github.com/daffl)) | ||
- Add feathers-query-filters [\#58](https://github.com/feathersjs/commons/pull/58) ([daffl](https://github.com/daffl)) | ||
## [v1.0.0](https://github.com/feathersjs/commons/tree/v1.0.0) (2017-10-19) | ||
@@ -4,0 +12,0 @@ [Full Changelog](https://github.com/feathersjs/commons/compare/v1.0.0-pre.3...v1.0.0) |
@@ -137,1 +137,14 @@ // Removes all leading and trailing slashes from a path | ||
}; | ||
exports.makeUrl = function makeUrl (path, app = {}) { | ||
const get = typeof app.get === 'function' ? app.get.bind(app) : () => {}; | ||
const env = get('env') || process.env.NODE_ENV; | ||
const host = get('host') || process.env.HOST_NAME || 'localhost'; | ||
const protocol = (env === 'development' || env === 'test' || (env === undefined)) ? 'http' : 'https'; | ||
const PORT = get('port') || process.env.PORT || 3030; | ||
const port = (env === 'development' || env === 'test' || (env === undefined)) ? `:${PORT}` : ''; | ||
path = path || ''; | ||
return `${protocol}://${host}${port}/${exports.stripSlashes(path)}`; | ||
}; |
{ | ||
"name": "@feathersjs/commons", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Shared Feathers utility functions", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/feathersjs/commons", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36483
14
565