Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzie committed Jan 29, 2024
1 parent 2ea1ed0 commit e3c26bc
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 11 deletions.
Binary file removed Assets/Logo.afdesign
Binary file not shown.
Binary file removed Assets/Logo.png
Binary file not shown.
1 change: 0 additions & 1 deletion Assets/Logo.svg

This file was deleted.

Binary file added Source/Assets/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Source/Assets/Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Source/Dockerfile.UI
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ RUN npm i -g serve
COPY --from=Build src/dist ./dist

EXPOSE 80

ENV VITE_API_URL=localhost:8080
CMD [ "serve", "-s", "dist", "-l", "80" ]
1 change: 1 addition & 0 deletions Source/Topica.UI/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_URL=http://localhost:8080
4 changes: 3 additions & 1 deletion Source/Topica.UI/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<!-- Load environment variables -->
<script src='/config.js'></script>
<title>Topica</title>
</head>
<body>
<div id="root"></div>
Expand Down
9 changes: 7 additions & 2 deletions Source/Topica.UI/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,20 @@ const middlewares: eventsClient.Middleware[] = [
}
];

// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/ban-ts-comment
// @ts-ignore
const url = import.meta.env.VITE_API_URL;

const eventsConfig = () =>
new eventsClient.Configuration({
basePath: import.meta.env.VITE_API_SERVER_URL,
basePath: url,
middleware: middlewares
});


export const topicApi = new eventsClient.TopicsApi(eventsConfig());
export const loginApi = new eventsClient.LoginApi( new eventsClient.Configuration({
basePath: import.meta.env.VITE_API_SERVER_URL,
basePath: url,
}));

export function getCookie(name: string) {
Expand Down
Empty file removed Source/Topica.UI/src/config.js
Empty file.
2 changes: 1 addition & 1 deletion Source/Topica.UI/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"include": ["src", "../Assets/config.js"],
"references": [{ "path": "./tsconfig.node.json" }]
}
5 changes: 4 additions & 1 deletion Source/Topica.UI/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'

// eslint-disable-next-line @typescript-eslint/no-var-requires
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server:{
port:3001
}
})
6 changes: 2 additions & 4 deletions Source/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ services:
image: ${DOCKER_REGISTRY-}topica.server
container_name: topica.server
ports:
- 8780:8080
- 8080:8080
build:
context: ./Topica.Server/Topica.Server
dockerfile: Dockerfile
topica.ui:
image: ${DOCKER_REGISTRY-}topica.ui
container_name: topica.ui
ports:
- 8680:80
environment:
- VITE_API_SERVER_URL=https://localhost:8780
- 3001:80
build:
context: .
dockerfile: Dockerfile.UI

0 comments on commit e3c26bc

Please sign in to comment.