Skip to content

Commit

Permalink
Added initial controller route for #14
Browse files Browse the repository at this point in the history
  • Loading branch information
thejhh committed Apr 24, 2022
1 parent 3772277 commit ac05c58
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/controllers/HgHsBackendController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,33 @@ export class HgHsBackendController {
): Promise<ResponseEntity<ReadonlyJsonObject | {readonly error: string}>> {
try {

LOG.debug(`inviteToRoom: roomId = `, roomId, eventName, tnxId);
LOG.debug(`sendEventToRoomWithTnxId: roomId = `, roomId, eventName, tnxId);

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)
);
}
}

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

LOG.debug(`createRoom`);

return ResponseEntity.ok(
{
Expand Down

0 comments on commit ac05c58

Please sign in to comment.