Permalink
Browse files

Implement usePagePort option

  • Loading branch information...
1 parent 3a608c5 commit 4818f3ee67a3d6150010a85bc276d2706eb920c6 @marcuswestin committed Jul 12, 2011
Showing with 6 additions and 2 deletions.
  1. +1 −0 Changelog
  2. +5 −2 server.js
View
@@ -8,6 +8,7 @@ intended v0.4.5
+ Implement addReplacement for replacing code during dev serving or compilation
+ Implement dontAddClosureForModule and dontIncludeModule for compiler
+ Remove dependency on std.js
++ Add usePagePort option to make module requests go to the host/port of the page it's served on, rather than the host/port passed in to listen(port, ...)
v0.4.4
+ Import js files directly under node_modules correctly, e.g. ./node_modules/foo.js
View
@@ -176,8 +176,11 @@ function _sendError(res, msg) {
}
function _getBase() {
- if (opts.host && opts.port) {
- return '//' + opts.host + ':' + opts.port + '/' + opts.root
+ var host = opts.host,
+ port = (!opts.usePagePort && opts.port)
+
+ if (host && port) {
+ return '//' + host + ':' + port + '/' + opts.root
} else {
return '/' + opts.root
}

0 comments on commit 4818f3e

Please sign in to comment.