struct Orion::Router
- Orion::Router
- Struct
- Value
- Object
Overview
The Orion::Router
is the workhorse that does the work when a request comes
into your application. It will take all of your defined routes and builds you
an application that can serve HTTP traffic. You can configure the router using
the config
in a single file router. Or by calling the .new
or .start
method within your app.
Defined in:
orion/router.crConstructors
Class Method Summary
Instance Method Summary
-
#bind(*, tls : Nil = nil, uri)
Bind using a URI
-
#bind(*, tls : OpenSSL::SSL::Context::Server, address : Socket::IPAddress)
Bind TLS with an address
-
#bind(*, tls : OpenSSL::SSL::Context::Server, host = ::Socket::IPAddress::LOOPBACK, port = nil, reuse_port = false)
Bind TLS with a host and port
-
#bind(*, tls : Nil = nil, host = ::Socket::IPAddress::LOOPBACK, port = nil, reuse_port = false)
Bind TCP to a host and port
-
#bind(*, tls : Nil = nil, address : Socket::IPAddress, reuse_port = false)
Bind TCP to a Socket::IPAddress
-
#bind(*, tls = nil, address : Socket::UNIXAddress)
Bind to a Socket::UnixAddress
- #bind(*, tls = nil, path)
-
#bind(*, config : Orion::Config)
Bind using a config
- #call(*args, **options)
- #call(*args, **options, &)
- #handlers : Array(HTTP::Handler)
-
#listen(*, workers, **opts)
Listen clients using multiple workers A good suggestion is to use System.cpu_count
-
#listen(*args, prefix = self.class.name, **opts)
Listen for clients
- #request_processor
- #use(handler : HTTP::Handler)
- #use(handler)
-
#visualize
Visualize the route tree
Constructor Detail
Class Method Detail
Instance Method Detail
Bind TLS with an address
Bind TLS with a host and port
Bind TCP to a host and port
Bind TCP to a Socket::IPAddress
Listen clients using multiple workers A good suggestion is to use System.cpu_count