Skip to content

Commit

Permalink
Add collaboration and matching services to gateway routing
Browse files Browse the repository at this point in the history
  • Loading branch information
yhtMinceraft1010X committed Oct 8, 2023
1 parent cde0be3 commit 9bb7530
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion services/gateway/src/proxied_routes/proxied_routes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import {ProxiedRoute} from "./proxied_route_type";
import {adminServiceAddress, questionServiceAddress, userServiceAddress} from "./service_names";
import {
adminServiceAddress,
collaborationServiceAddress,
matchingServiceAddress,
questionServiceAddress,
userServiceAddress
} from "./service_names";

export const proxied_routes : ProxiedRoute[] = [
{
Expand Down Expand Up @@ -31,6 +37,33 @@ export const proxied_routes : ProxiedRoute[] = [
},
},
},
{
url: '/api/question-service',
admin_required_methods: ["POST, PUT, DELETE"], // Only admins can create, update or delete questions
user_match_required_methods: [], // No need for exact user match here
proxy: {
target: questionServiceAddress,
changeOrigin: true,
}
},
{
url: '/api/matching-service',
admin_required_methods: [],
user_match_required_methods: [], // No need for exact user match here
proxy: {
target: matchingServiceAddress,
changeOrigin: true,
}
},
{
url: '/api/collaboration-service',
admin_required_methods: [],
user_match_required_methods: [], // No need for exact user match here
proxy: {
target: collaborationServiceAddress,
changeOrigin: true,
}
},
{
url: '/api/question-service',
admin_required_methods: ["POST, PUT, DELETE"], // All routes in admin service can only be accessed by admins
Expand Down

0 comments on commit 9bb7530

Please sign in to comment.