Skip to content

Commit

Permalink
Added initial controller route for #14 (previous commit was meant for #…
Browse files Browse the repository at this point in the history
  • Loading branch information
thejhh committed Apr 24, 2022
1 parent ac05c58 commit ec37e25
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/controllers/HgHsBackendController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,4 +432,32 @@ export class HgHsBackendController {
}
}

@PostMapping("/_matrix/client/r0/rooms/:roomId/join")
public static async joinToRoom (
@RequestHeader(MATRIX_AUTHORIZATION_HEADER_NAME, {
required: false,
defaultValue: ''
})
token: string,
@PathVariable('roomId', {required: true})
roomId = ""
): Promise<ResponseEntity<ReadonlyJsonObject | {readonly error: string}>> {
try {

LOG.debug(`joinToRoom`);

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 ec37e25

Please sign in to comment.