Setup eslint and enforce rules
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-06-02 22:36:25 -05:00
parent 82e7a1f299
commit 1d5056b753
149 changed files with 6104 additions and 3114 deletions

View File

@@ -1,5 +1,5 @@
import {ResponseFactory} from "./ResponseFactory";
import {Request} from "../lifecycle/Request";
import {ResponseFactory} from './ResponseFactory'
import {Request} from '../lifecycle/Request'
/**
* Helper function that creates a new HTMLResponseFactory.
@@ -15,9 +15,11 @@ export function html(value: string): HTMLResponseFactory {
export class HTMLResponseFactory extends ResponseFactory {
constructor(
public readonly value: string,
) { super() }
) {
super()
}
public async write(request: Request) {
public async write(request: Request): Promise<Request> {
request = await super.write(request)
request.response.setHeader('Content-Type', 'text/html; charset=utf-8')
request.response.body = this.value