# AppServer.startupFunction.

startup(port::Int = 8000) :: Void

Starts the web server on the configurated port. Automatically invoked when Genie is started with the s or the server:start command line params. Can be manually invoked from the REPL as well, when starting Genie without the above params – ideally async to allow reusing the REPL session.

Examples

julia> @spawn AppServer.startup()
Listening on 0.0.0.0:8000...
Future(1,1,1,Nullable{Any}())

source

# AppServer.handle_connectFunction.

handle_connect(client::HttpServer.Client) :: Void

Connection callback for HttpServer. Stores the Request IP in the current task's local storage.

source

# AppServer.handle_requestFunction.

handle_request(req::Request, res::Response, ip::IPv4 = ip"0.0.0.0") :: Response

HttpServer handler function - invoked when the server gets a request.

source

# AppServer.sign_response!Function.

sign_response!(res::Response) :: Response

Adds a signature header to the response using the value in Genie.config.server_signature. If Genie.config.server_signature is empty, the header is not added.

source

# AppServer.log_requestFunction.

log_request(req::Request) :: Void

Logs information about the request.

source

# AppServer.log_responseFunction.

log_response(req::Request, res::Response) :: Void

Logs information about the response.

source

# AppServer.log_request_responseFunction.

log_request_response(req_res::Union{Request,Response}) :: Void

Helper function that logs Request or Response objects.

source

# AppServer.parse_inner_dictFunction.

parse_inner_dict{K,V}(d::Dict{K,V}) :: Dict{String,String}

Helper function that knows how to parse a Dict containing Request or Response data and prepare it for being logged.

source