Skip to content

Commit

Permalink
fix:webapp routing issues while hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
Rithick574 committed Jul 9, 2024
1 parent da97ee8 commit 79139a5
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 59 deletions.
2 changes: 1 addition & 1 deletion auth-service/src/presentation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ app.use(cookieParser());



app.use("/",routes(dependencies))
app.use("/api/auth",routes(dependencies))

app.use("*",(req: Request, res: Response) => {
res.status(404).json({ success: false, status: 404, message: "Api Not found" });
Expand Down
2 changes: 1 addition & 1 deletion chat-service/src/presentation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ app.use(
);

connectSocketIo(server)
app.use('/',router(dependencies))
app.use('/api/chat',router(dependencies))

//to catch unknown routes
app.use("*", (req: Request, res: Response) => {
Expand Down
2 changes: 1 addition & 1 deletion course-service/src/presentation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ app.use(helmet());
app.use(morgan("dev"));


app.use("/",routes(dependencies));
app.use("/api/course",routes(dependencies));


app.use("*",(req: Request, res: Response) => {
Expand Down
101 changes: 47 additions & 54 deletions manifests/k8s/ingress-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,53 @@ metadata:
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
cert-manager.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-origin: "https://phonebazaar.shop"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-origin: "https://learnwise-client.onrender.com"
spec:
ingressClassName: webapprouting.kubernetes.azure.com
rules:
- host: phonebazaar.shop
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: learnwisefrontend-service
port:
number: 5173
- path: /api/auth
pathType: Prefix
backend:
service:
name: learnwise-auth-service
port:
number: 4001
- path: /api/user
pathType: Prefix
backend:
service:
name: learnwise-user-service
port:
number: 4002
- path: /api/notification
pathType: Prefix
backend:
service:
name: learnwise-notification-service
port:
number: 4003
- path: /api/course
pathType: Prefix
backend:
service:
name: learnwise-course-service
port:
number: 4004
- path: /api/payment
pathType: Prefix
backend:
service:
name: learnwise-payment-service
port:
number: 4005
- path: /api/chat
pathType: Prefix
backend:
service:
name: learnwise-chat-service
port:
number: 4006
- host: phonebazaar.shop
http:
paths:
- path: /api/auth
pathType: Prefix
backend:
service:
name: learnwise-auth-service
port:
number: 4001
- path: /api/user
pathType: Prefix
backend:
service:
name: learnwise-user-service
port:
number: 4002
- path: /api/notification
pathType: Prefix
backend:
service:
name: learnwise-notification-service
port:
number: 4003
- path: /api/course
pathType: Prefix
backend:
service:
name: learnwise-course-service
port:
number: 4004
- path: /api/payment
pathType: Prefix
backend:
service:
name: learnwise-payment-service
port:
number: 4005
- path: /api/chat
pathType: Prefix
backend:
service:
name: learnwise-chat-service
port:
number: 4006
2 changes: 1 addition & 1 deletion payment-service/src/presentation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ app.use(cookieParser());
app.use(morgan("dev"));


app.use("/",routes(dependencies))
app.use("/api/payment",routes(dependencies))

app.use("*",(req: Request, res: Response) => {
res.status(404).json({ success: false, status: 404, message: "Api Not found" });
Expand Down
2 changes: 1 addition & 1 deletion user-service/src/users/users.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { JwtAuthGuard } from '../auth/jwt-auth.guard';
import * as bcrypt from 'bcrypt';
import { InstructorQueryDto } from './dto/instructor-query.dto';

@Controller()
@Controller('api/user')
export class UsersController {
constructor(
private readonly userService: UsersService,
Expand Down

0 comments on commit 79139a5

Please sign in to comment.