Skip to content

Commit

Permalink
Added initial controller route for #15
Browse files Browse the repository at this point in the history
  • Loading branch information
thejhh committed Apr 24, 2022
1 parent ec37e25 commit 3ee7123
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/controllers/HgHsBackendController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,4 +460,40 @@ export class HgHsBackendController {
}
}

@GetMapping("/_matrix/client/r0/sync")
public static async sync (
@RequestHeader(MATRIX_AUTHORIZATION_HEADER_NAME, {
required: false,
defaultValue: ''
})
token: string,
@PathVariable('filter', {required: true})
filter = "",
@PathVariable('since', {required: true})
since = "",
@PathVariable('full_state', {required: true})
full_state = "",
@PathVariable('set_presence', {required: true})
set_presence = "",
@PathVariable('timeout', {required: true})
timeout = ""
): Promise<ResponseEntity<ReadonlyJsonObject | {readonly error: string}>> {
try {

LOG.debug(`sync: `, filter, since, full_state, set_presence, timeout);

return ResponseEntity.ok(
{
hello: 'world'
} as unknown as ReadonlyJsonObject
);

} catch (err) {
LOG.error(`ERROR: `, err);
return ResponseEntity.internalServerError<{readonly error: string}>().body(
createErrorDTO('Internal Server Error', 500)
);
}
}

}

0 comments on commit 3ee7123

Please sign in to comment.