You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
426 B
17 lines
426 B
import ResponseFactory from './ResponseFactory.ts'
|
|
import {Request} from '../Request.ts'
|
|
|
|
export default class StringResponseFactory extends ResponseFactory {
|
|
constructor(
|
|
public readonly value: string,
|
|
) {
|
|
super()
|
|
}
|
|
|
|
public async write(request: Request): Promise<Request> {
|
|
request = await super.write(request)
|
|
request.response.body = this.value
|
|
return request
|
|
}
|
|
}
|