File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,10 @@ const md5 = require('md5');
44const path = require ( 'path' ) ;
55const socketio = require ( 'socket.io' ) ;
66
7+ const DEFAULT_PORT = 3008 ;
8+
79const {
8- PORT = 3008 ,
10+ PORT = DEFAULT_PORT ,
911 NODE_ENV = 'production'
1012} = process . env ;
1113
@@ -28,7 +30,8 @@ const server = http.createServer((req, res) => {
2830 fs . readFile ( filePath , 'utf8' , ( err , data ) => {
2931 if ( err ) return showError ( ) ;
3032 res . writeHead ( 200 , { 'Content-Type' : contentType } ) ;
31- res . end ( data , 'utf-8' ) ;
33+ const content = data . replace ( DEFAULT_PORT , PORT ) ;
34+ res . end ( content , 'utf-8' ) ;
3235 } ) ;
3336 } else {
3437 showError ( ) ;
Original file line number Diff line number Diff line change 1- const [ a , b ] = window . location . origin . split ( ':' ) ;
2- const origin = [ a , b , 3008 ] . join ( ':' ) ;
1+ const _origin = window . location . port
2+ ? window . location . origin . replace ( `:${ window . location . port } ` )
3+ : window . location . origin ;
4+ const origin = `${ _origin } :${ 3008 } ` ;
35
46const updateCSS = fileName => {
57 // TODO(bret): At some point, set it up to just update the CSS that it needs to...
You can’t perform that action at this time.
0 commit comments