mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Add new ServerHandler package which handles requests
This commit is contained in:
parent
3cdd685035
commit
327a716b12
10 changed files with 616 additions and 110 deletions
|
|
@ -136,12 +136,8 @@ export class RequestParser {
|
|||
* @private
|
||||
* @throws Error if body is invalid
|
||||
*/
|
||||
private async parseJson<T>(): Promise<Partial<T>> {
|
||||
try {
|
||||
return (await this.request.json()) as T;
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
private async parseJson<T>(): Promise<T> {
|
||||
return (await this.request.json()) as T;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue