class
Runcobo::Tasks::DevServer
- Runcobo::Tasks::DevServer
- Reference
- Object
Overview
Builds src/main.cr, runs it, and rebuilds and restarts it when its sources change. A new binary replaces the running server only after it builds, so a broken edit leaves the previous version serving.
Defined in:
tasks/dev_server.crConstant Summary
-
ENTRY =
"src/main.cr" -
STOP_TIMEOUT =
10.seconds
Constructors
Instance Method Summary
- #binary : Path
-
#restart : Bool
Builds a new binary and swaps it in only if the build succeeds.
- #run
-
#stop
Asks the server to shut down gracefully, then kills it after STOP_TIMEOUT.
Constructor Detail
def self.new(settings : Config, environment : Hash(String, String), output : IO = STDERR, interval : Time::Span = 0.5.seconds)
#