Start routing and pipeline rewrite
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-01-17 15:57:40 -06:00
parent 9b8333295f
commit 8cf19792a6
34 changed files with 470 additions and 1654 deletions

View File

@@ -1,5 +1,5 @@
import {Inject, Singleton} from '../di'
import {Awaitable, Collection, ErrorWithContext, Maybe, Pipe, universalPath, UniversalPath} from '../util'
import {Awaitable, Collection, ErrorWithContext, Maybe, Pipeline, universalPath, UniversalPath} from '../util'
import {Unit, UnitStatus} from '../lifecycle/Unit'
import {Logging} from './Logging'
import {Route} from '../http/routing/Route'
@@ -168,7 +168,7 @@ export class Routing extends Unit {
const isSSL = rawHost.startsWith('https://')
const port = this.config.get('server.port', 8000)
return Pipe.wrap<string>(rawHost)
return Pipeline.id<string>()
.unless(
host => host.startsWith('http://') || host.startsWith('https'),
host => `http://${host}`,
@@ -187,7 +187,7 @@ export class Routing extends Unit {
},
)
.tap<UniversalPath>(host => universalPath(host))
.get()
.apply(rawHost)
}
/**