This repository was archived by the owner on Nov 19, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,21 @@ module.exports = rocky.Rocky
99 * Extends Rocky Base prototype chain with
1010 * Toxy domain specific convenient methods.
1111 *
12- * @class RockyBase
12+ * @param {Object } opts
13+ * @class ToxyProxy
14+ * @extends rocky.Rocky
15+ */
16+
17+ /**
18+ * Alias to rocky.Base class.
1319 */
1420
1521const RockyBase = rocky . Base
1622
23+ /**
24+ * Proxy prototype methods
25+ */
26+
1727RockyBase . prototype . rule =
1828RockyBase . prototype . filter = Directive . prototype . rule
1929
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ module.exports = Toxy
1616
1717function Toxy ( opts ) {
1818 if ( ! ( this instanceof Toxy ) ) return new Toxy ( opts )
19+
20+ opts = Object . assign ( Toxy . defaults , opts )
1921 Proxy . call ( this , opts )
2022
2123 this . routes = [ ]
@@ -26,6 +28,15 @@ function Toxy (opts) {
2628 setupMiddleware ( this )
2729}
2830
31+ /**
32+ * Defines default rocky proxy options.
33+ *
34+ * @property {Object } defaults
35+ * @static
36+ */
37+
38+ Toxy . defaults = { changeOrigin : true }
39+
2940/**
3041 * Default TCP port to listen.
3142 *
You can’t perform that action at this time.
0 commit comments