@aurelia/http-server
Advanced tools
Comparing version 2.0.0-beta.14 to 2.0.0-beta.15
@@ -6,2 +6,9 @@ # Change Log | ||
<a name="2.0.0-beta.15"></a> | ||
# 2.0.0-beta.15 (2024-04-17) | ||
### Refactorings: | ||
* ***:** migration to TC39 decorators + metadata simplification (#1932) ([22f90ad](https://github.com/aurelia/aurelia/commit/22f90ad)) | ||
<a name="2.0.0-beta.14"></a> | ||
@@ -8,0 +15,0 @@ # 2.0.0-beta.14 (2024-04-03) |
@@ -1,4 +0,4 @@ | ||
import { ILogger, IContainer } from '@aurelia/kernel'; | ||
import { IHttpServer, IHttpServerOptions, IRequestHandler, StartOutput, IHttp2FileServer } from './interfaces'; | ||
import { IHttpServer, StartOutput } from './interfaces'; | ||
export declare class HttpServer implements IHttpServer { | ||
private server; | ||
private readonly logger; | ||
@@ -8,4 +8,2 @@ private readonly opts; | ||
private readonly handlers; | ||
private server; | ||
constructor(logger: ILogger, opts: IHttpServerOptions, container: IContainer, handlers: readonly IRequestHandler[]); | ||
start(): Promise<StartOutput>; | ||
@@ -16,2 +14,3 @@ stop(): Promise<void>; | ||
export declare class Http2Server implements IHttpServer { | ||
private server; | ||
private readonly logger; | ||
@@ -21,4 +20,2 @@ private readonly opts; | ||
private readonly http2FileServer; | ||
private server; | ||
constructor(logger: ILogger, opts: IHttpServerOptions, container: IContainer, http2FileServer: IHttp2FileServer); | ||
start(): Promise<StartOutput>; | ||
@@ -25,0 +22,0 @@ stop(): Promise<void>; |
@@ -1,10 +0,9 @@ | ||
import { ILogger } from '@aurelia/kernel'; | ||
import { IRequestHandler, IHttpServerOptions, IHttp2FileServer } from '../interfaces'; | ||
import { IRequestHandler, IHttp2FileServer } from '../interfaces'; | ||
import { IHttpContext } from '../http-context'; | ||
export declare class FileServer implements IRequestHandler { | ||
private readonly root; | ||
private readonly cacheControlDirective; | ||
private readonly opts; | ||
private readonly logger; | ||
private readonly root; | ||
private readonly cacheControlDirective; | ||
constructor(opts: IHttpServerOptions, logger: ILogger); | ||
constructor(); | ||
handleRequest(context: IHttpContext): Promise<void>; | ||
@@ -16,8 +15,8 @@ } | ||
export declare class Http2FileServer implements IHttp2FileServer { | ||
private readonly opts; | ||
private readonly logger; | ||
private readonly cacheControlDirective; | ||
private readonly root; | ||
private readonly filePushMap; | ||
constructor(opts: IHttpServerOptions, logger: ILogger); | ||
private readonly opts; | ||
private readonly logger; | ||
constructor(); | ||
handleRequest(context: IHttpContext): void; | ||
@@ -24,0 +23,0 @@ private pushAll; |
{ | ||
"name": "@aurelia/http-server", | ||
"version": "2.0.0-beta.14", | ||
"version": "2.0.0-beta.15", | ||
"main": "dist/cjs/index.cjs", | ||
@@ -52,6 +52,6 @@ "module": "dist/esm/index.mjs", | ||
"dependencies": { | ||
"@aurelia/kernel": "2.0.0-beta.14", | ||
"@aurelia/metadata": "2.0.0-beta.14", | ||
"@aurelia/platform": "2.0.0-beta.14", | ||
"@aurelia/runtime": "2.0.0-beta.14" | ||
"@aurelia/kernel": "2.0.0-beta.15", | ||
"@aurelia/metadata": "2.0.0-beta.15", | ||
"@aurelia/platform": "2.0.0-beta.15", | ||
"@aurelia/runtime": "2.0.0-beta.15" | ||
}, | ||
@@ -58,0 +58,0 @@ "devDependencies": { |
@@ -6,3 +6,3 @@ import { readFileSync } from 'fs'; | ||
import { ILogger, bound, all, IContainer } from '@aurelia/kernel'; | ||
import { ILogger, bound, all, IContainer, resolve } from '@aurelia/kernel'; | ||
import { IHttpServer, IHttpServerOptions, IRequestHandler, StartOutput, IHttp2FileServer } from './interfaces'; | ||
@@ -16,14 +16,6 @@ import { AddressInfo } from 'net'; | ||
public constructor( | ||
@ILogger | ||
private readonly logger: ILogger, | ||
@IHttpServerOptions | ||
private readonly opts: IHttpServerOptions, | ||
@IContainer | ||
private readonly container: IContainer, | ||
@all(IRequestHandler) | ||
private readonly handlers: readonly IRequestHandler[], | ||
) { | ||
this.logger = logger.root.scopeTo('HttpServer'); | ||
} | ||
private readonly logger: ILogger = resolve(ILogger).root.scopeTo('HttpServer'); | ||
private readonly opts: IHttpServerOptions = resolve(IHttpServerOptions); | ||
private readonly container: IContainer = resolve(IContainer); | ||
private readonly handlers: readonly IRequestHandler[] = resolve(all(IRequestHandler)); | ||
@@ -78,14 +70,6 @@ public async start(): Promise<StartOutput> { | ||
public constructor( | ||
@ILogger | ||
private readonly logger: ILogger, | ||
@IHttpServerOptions | ||
private readonly opts: IHttpServerOptions, | ||
@IContainer | ||
private readonly container: IContainer, | ||
@IHttp2FileServer | ||
private readonly http2FileServer: IHttp2FileServer, | ||
) { | ||
this.logger = logger.root.scopeTo('Http2Server'); | ||
} | ||
private readonly logger: ILogger = resolve(ILogger).root.scopeTo('Http2Server'); | ||
private readonly opts: IHttpServerOptions = resolve(IHttpServerOptions); | ||
private readonly container: IContainer = resolve(IContainer); | ||
private readonly http2FileServer: IHttp2FileServer = resolve(IHttp2FileServer); | ||
@@ -92,0 +76,0 @@ public async start(): Promise<StartOutput> { |
@@ -5,3 +5,3 @@ import { statSync, openSync, readdirSync } from 'fs'; | ||
import { join, resolve, relative, extname } from 'path'; | ||
import { ILogger } from '@aurelia/kernel'; | ||
import { ILogger, resolve as diResolve } from '@aurelia/kernel'; | ||
import { IRequestHandler, IHttpServerOptions, IHttp2FileServer } from '../interfaces'; | ||
@@ -33,13 +33,9 @@ import { IHttpContext } from '../http-context'; | ||
public constructor( | ||
@IHttpServerOptions | ||
private readonly opts: IHttpServerOptions, | ||
@ILogger | ||
private readonly logger: ILogger, | ||
) { | ||
private readonly opts: IHttpServerOptions = diResolve(IHttpServerOptions); | ||
private readonly logger: ILogger = diResolve(ILogger).root.scopeTo('FileServer'); | ||
public constructor() { | ||
this.cacheControlDirective = this.opts.responseCacheControl ?? 'max-age=3600'; | ||
this.logger = logger.root.scopeTo('FileServer'); | ||
this.root = resolve(this.opts.root); | ||
this.root = resolve(opts.root); | ||
this.logger.debug(`Now serving files from: "${this.root}"`); | ||
@@ -115,12 +111,8 @@ } | ||
public constructor( | ||
@IHttpServerOptions | ||
private readonly opts: IHttpServerOptions, | ||
@ILogger | ||
private readonly logger: ILogger, | ||
) { | ||
private readonly opts: IHttpServerOptions = diResolve(IHttpServerOptions); | ||
private readonly logger: ILogger = diResolve(ILogger).root.scopeTo('Http2FileServer'); | ||
public constructor() { | ||
this.cacheControlDirective = this.opts.responseCacheControl ?? 'max-age=3600'; | ||
this.logger = logger.root.scopeTo('Http2FileServer'); | ||
this.root = resolve(opts.root); | ||
this.root = resolve(this.opts.root); | ||
this.prepare(); | ||
@@ -127,0 +119,0 @@ this.logger.debug(`Now serving files from: "${this.root}"`); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
495739
3879
+ Added@aurelia/expression-parser@2.0.0-beta.15(transitive)
+ Added@aurelia/kernel@2.0.0-beta.15(transitive)
+ Added@aurelia/metadata@2.0.0-beta.15(transitive)
+ Added@aurelia/platform@2.0.0-beta.15(transitive)
+ Added@aurelia/runtime@2.0.0-beta.15(transitive)
- Removed@aurelia/kernel@2.0.0-beta.14(transitive)
- Removed@aurelia/metadata@2.0.0-beta.14(transitive)
- Removed@aurelia/platform@2.0.0-beta.14(transitive)
- Removed@aurelia/runtime@2.0.0-beta.14(transitive)