Skip to content

Commit 201566f

Browse files
authored
Merge pull request #187 from wilesun/master
add the serverInit callback,its goal add the on('upgrade',function(){})
2 parents dbca1de + fa6bb1d commit 201566f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.coffee

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class ConnectApp
2424
@https = options.https || false
2525
@livereload = options.livereload || false
2626
@middleware = options.middleware || undefined
27+
@serverInit = options.serverInit || undefined
2728
@fallback = options.fallback || undefined
2829
@oldMethod("open") if options.open
2930
@sockets = []
@@ -60,7 +61,8 @@ class ConnectApp
6061
@server = (http2 || https).createServer(@https, @app)
6162
else
6263
@server = http.createServer @app
63-
64+
if @serverInit
65+
@serverInit @server
6466
@server.listen @port, (err) =>
6567
if err
6668
@log "Error on starting server: #{err}"

0 commit comments

Comments
 (0)