Skip to content

Commit

Permalink
Fix entity table naming, url extracting from url. Improve naming in t…
Browse files Browse the repository at this point in the history
…he svc, hide tldraw-http-management from outside communication.
  • Loading branch information
blazejpass committed Nov 17, 2023
1 parent b4cb7da commit 74bf209
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,3 @@ spec:
port:
number: {{ PORT_TLDRAW }}
pathType: Prefix
- path: /tldraw-management
backend:
service:
name: tldraw-server-svc
port:
number: {{ PORT_TLDRAW_MANAGEMENT }}
pathType: Prefix
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ metadata:
spec:
type: ClusterIP
ports:
# Port used for WebSocket data transfers, and http calls for drawing b64 data saved in separate db
- port: 3345
targetPort: 3345
protocol: TCP
name: tldraw-server
# Port used for managing drawing tool representation in course board
name: tldraw-ws-server
- port: 3349
targetPort: 3349
protocol: TCP
name: tldraw-management
name: tldraw-http-management
selector:
app: tldraw
2 changes: 1 addition & 1 deletion apps/server/src/modules/tldraw/controller/tldraw.ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class TldrawWs implements OnGatewayInit, OnGatewayConnection {
}

private getDocNameFromRequest(request: Request): string {
const urlStripped = request.url.replace('/', '');
const urlStripped = request.url.replace(/(\/)|(tldraw-server)/g, '');
return urlStripped;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Entity, PrimaryKey, Property } from '@mikro-orm/core';
import { BadRequestException } from '@nestjs/common';
import { ObjectId } from '@mikro-orm/mongodb';

@Entity({ tableName: 'drawing' })
@Entity({ tableName: 'drawings' })
export class TldrawDrawing {
constructor(props: TldrawDrawingProps) {
if (!props.docName) throw new BadRequestException('Tldraw element should have name.');
Expand Down

0 comments on commit 74bf209

Please sign in to comment.