Skip to content

Commit

Permalink
Merge pull request #4 from zucchero-sintattico/feature-path-refactor
Browse files Browse the repository at this point in the history
Feature path refactor
  • Loading branch information
alemazzo authored Nov 25, 2023
2 parents 2fe5348 + ae4b02d commit d933c98
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ USERS_SERVICE_NAME=users
USERS_SERVICE_PORT=3000
USERS_SERVICE_URI=http://${USERS_SERVICE_NAME}:${USERS_SERVICE_PORT}

MULTIMEDIA_SERVICE_NAME=MULTIMEDIA
MULTIMEDIA_SERVICE_NAME=multimedia
MULTIMEDIA_SERVICE_PORT=3000
MULTIMEDIA_SERVICE_URI=http://${MULTIMEDIA_SERVICE_NAME}:${MULTIMEDIA_SERVICE_PORT}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ COPY ./services/ ./services/
RUN ["rm", "-rf", "services/*/dist"]
COPY ./tsconfig.json ./tsconfig.json
RUN [ "npm", "install" ]
# RUN [ "npm", "run", "--workspace", "services/frontend", "build", "--if-present" ]
RUN [ "npm", "run", "--workspace", "services/frontend", "build", "--if-present" ]
59 changes: 54 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions services/frontend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ services:
- frontend
labels:
- |
traefik.http.routers.frontend-service.rule=
(Method(`GET`) && PathPrefix(`/`))
traefik.http.routers.frontend-service.rule=Method(`GET`) && PathPrefix(`/`)
4 changes: 2 additions & 2 deletions services/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"build": "vite build",
"build:check": "run-p type-check build",
"start": "serve dist",
"start": "serve -s dist",
"dev": "vite --base /site",
"preview": "vite preview",
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
Expand Down Expand Up @@ -33,7 +33,7 @@
"@vue/tsconfig": "^0.4.0",
"eslint-plugin-vue": "^9.17.0",
"npm-run-all": "^4.1.5",
"sass": "1.32.12",
"sass": "1.33.0",
"vite": "^4.4.9",
"vue-tsc": "^1.8.8"
}
Expand Down
6 changes: 6 additions & 0 deletions services/frontend/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ const router = createRouter({
name: 'Monitoring',
component: MonitoringView,
meta: { requiresAuth: false }
},
{
path: '/:pathMatch(.*)*',
name: 'NotFound',
component: HomeView,
meta: { requiresAuth: true }
}
]
})
Expand Down
3 changes: 1 addition & 2 deletions services/messages/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ services:
- 'MONGO_URI=mongodb://db-messages-service:27017/messages'
labels:
- |
traefik.http.routers.messages-service.rule=
(Method(`GET`, `POST`) && Path(`/users/{username:[^/]+}/messages`)) ||
traefik.http.routers.messages-service.rule=(Method(`GET`, `POST`) && Path(`/users/{username:[^/]+}/messages`)) ||
(Method(`GET`, `POST`) && Path(`/servers/{serverId:[^/]+}/channels/{channelId:[^/]+}/messages`))
db-messages-service:
Expand Down
3 changes: 1 addition & 2 deletions services/monitoring/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ services:
- 'SERVICES_URI=${USERS_SERVICE_URI},${MESSAGES_SERVICE_URI},${PIPERCHAT_SERVICE_URI},${MULTIMEDIA_SERVICE_URI},${NOTIFICATIONS_SERVICE_URI}'
labels:
- |
traefik.http.routers.monitoring-service.rule=
(Method(`GET`) && Path(`/status`))
traefik.http.routers.monitoring-service.rule=Method(`GET`) && Path(`/status`)
db-monitoring-service:
image: mongo
Expand Down
3 changes: 1 addition & 2 deletions services/multimedia/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ services:
- 'MONGO_URI=mongodb://db-multimedia-service:27017/multimedia'
labels:
- |
traefik.http.routers.multimedia-service.rule=
(Method(`GET`) && PathPrefix(`/webrtc`)) ||
traefik.http.routers.multimedia-service.rule=(Method(`GET`) && PathPrefix(`/webrtc`)) ||
(Method(`GET`) && Path(`/users/{username:[^/]+}/session`))||
(Method(`GET`) && Path(`/servers/{serverId:[^/]+}/channels/{channelId:[^/]+}/session`))||
(Method(`GET`) && Path(`/sessions/{sessionId:[^/]+}`))
Expand Down
3 changes: 1 addition & 2 deletions services/notifications/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ services:
- 'MONGO_URI=mongodb://db-notifications-service:27017/notifications'
labels:
- |
traefik.http.routers.notifications-service.rule=
(Method(`GET`) && Path(`/users/{username:[^/]+}/status`)) ||
traefik.http.routers.notifications-service.rule=(Method(`GET`) && Path(`/users/{username:[^/]+}/status`)) ||
(Method(`GET`) && PathPrefix(`/notification`))
db-notifications-service:
Expand Down
3 changes: 1 addition & 2 deletions services/piperchat/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ services:
- 'MONGO_URI=mongodb://db-piperchat-service:27017/piperchat'
labels:
- |
traefik.http.routers.piperchat-service.rule=
(Method(`GET`, `POST`) && Path(`/servers`)) ||
traefik.http.routers.piperchat-service.rule=(Method(`GET`, `POST`) && Path(`/servers`)) ||
(Method(`GET`, `PUT`, `DELETE`) && Path(`/servers/{serverId:[^/]+}`)) ||
(Method(`GET`, `POST`, `DELETE`) && Path(`/servers/{serverId:[^/]+}/participants`)) ||
(Method(`DELETE`) && Path(`/servers/{serverId:[^/]+}/participants/{userId:[^/]+}`)) ||
Expand Down
3 changes: 1 addition & 2 deletions services/users/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ services:
- 'MONGO_URI=mongodb://db-users-service:27017/users'
labels:
- |
traefik.http.routers.users-service.rule=
(Method(`POST`) && Path(`/auth/{p:(login|register|logout|refresh-token)}`)) ||
traefik.http.routers.users-service.rule=(Method(`POST`) && Path(`/auth/{p:(login|register|logout|refresh-token)}`)) ||
(Method(`PUT`) && Path(`/profile/{p:(photo|description)}`)) ||
(Method(`GET`) && Path(`/friends`)) ||
(Method(`GET`, `POST`) && Path(`/friends/requests`)) ||
Expand Down

0 comments on commit d933c98

Please sign in to comment.