File tree Expand file tree Collapse file tree 4 files changed +14
-149
lines changed Expand file tree Collapse file tree 4 files changed +14
-149
lines changed Original file line number Diff line number Diff line change 1
1
name = " LiveServer"
2
2
uuid = " 16fef848-5104-11e9-1b77-fb7a48bbb589"
3
3
authors = [" Jonas Asprion <jonas.asprion@gmx.ch" , " Thibaut Lienart <tlienart@me.com>" ]
4
- version = " 0.2.1 "
4
+ version = " 0.3.0 "
5
5
6
6
[deps ]
7
7
Crayons = " a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
@@ -12,7 +12,7 @@ Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
12
12
Test = " 8dfed614-e22c-5e08-85e1-65c5234f0b40"
13
13
14
14
[compat ]
15
- julia = " ^1.0.0"
16
- Documenter = " ^0.22.0"
17
15
Crayons = " ^4.0.0"
16
+ Documenter = " ^0.22.0"
18
17
HTTP = " ^0.8.0"
18
+ julia = " ^1.0.0"
Original file line number Diff line number Diff line change @@ -11,34 +11,29 @@ export serve, servedocs
11
11
# Environment variables
12
12
#
13
13
14
- # see `client.html`
14
+ """ Script to insert on a page for live reload, see `client.html`. """
15
15
const BROWSER_RELOAD_SCRIPT = read (joinpath (dirname (pathof (LiveServer)), " client.html" ), String)
16
- # whether to display messages while serving or not, see `verbose()`
16
+
17
+ """ Whether to display messages while serving or not, see [`verbose`](@ref)."""
17
18
const VERBOSE = Ref {Bool} (false )
18
- # the folder to watch, either the current one or a specified one.4
19
+
20
+ """ The folder to watch, either the current one or a specified one."""
19
21
const CONTENT_DIR = Ref {String} (" " )
20
- # list of files being tracked by WebSocket connections, interrupt catched in ws handler?
22
+
23
+ """ List of files being tracked with WebSocket connections."""
21
24
const WS_VIEWERS = Dict {String,Vector{HTTP.WebSockets.WebSocket}} ()
22
- # keep track of whether an interruption happened while processing a websocket
23
- const WS_INTERRUPT = Base. Ref {Bool} (false )
24
25
25
- #
26
- # HTTP patch
27
- #
28
- include (" http_patch.jl" )
26
+ """ Keep track of whether an interruption happened while processing a websocket."""
27
+ const WS_INTERRUPT = Base. Ref {Bool} (false )
29
28
30
29
#
31
- # Core
30
+ # Functions
32
31
#
33
32
34
33
include (" mimetypes.jl" )
35
34
include (" file_watching.jl" )
36
35
include (" server.jl" )
37
36
38
- #
39
- # Utilities
40
- #
41
-
42
37
include (" utils.jl" )
43
38
44
39
end # module
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -216,6 +216,7 @@ function serve(fw::FileWatcher=SimpleWatcher(file_changed_callback);
216
216
println (" ✓ LiveServer listening on http://localhost:$port / ...\n (use CTRL+C to shut down)" )
217
217
@async HTTP. listen (Sockets. localhost, port;
218
218
server= server, readtimeout= 0 , reuse_limit= 0 ) do http:: HTTP.Stream
219
+ # reuse_limit=0 ensures that there won't be an error if killing and restarting the server.
219
220
if HTTP. WebSockets. is_upgrade (http. message)
220
221
# upgrade to websocket
221
222
ws = ws_upgrade (http)
You can’t perform that action at this time.
0 commit comments