Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front: use browser relative path instead of env domain #6259

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docker/gateway-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh

>/tmp/front_config jq -rn '{
OSRD_BACKEND_URL: env.OSRD_BACKEND_URL,
OSRD_SENTRY_DSN: env.OSRD_SENTRY_DSN,
OSRD_SENTRY_ENVIRONMENT: env.OSRD_SENTRY_ENVIRONMENT,
OSRD_GIT_DESCRIBE: env.OSRD_GIT_DESCRIBE,
Expand Down
1 change: 0 additions & 1 deletion front/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
OSRD_BACKEND_URL=http://example.com/api
OSRD_SENTRY_DSN=https://[email protected]/42
OSRD_SENTRY_ENVIRONMENT=staging
OSRD_GIT_DESCRIBE=xxxxxx
1 change: 0 additions & 1 deletion front/.env.local.defaults
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
OSRD_BACKEND_URL=http://localhost:4000
OSRD_SENTRY_DSN=
OSRD_SENTRY_ENVIRONMENT=
OSRD_GIT_DESCRIBE=
Expand Down
2 changes: 1 addition & 1 deletion front/src/common/Map/Layers/blankStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const useMapBlankStyle = (): MapProps['mapStyle'] => {
? [
{ url: 'https://static.osm.osrd.fr/sprites/sprites', id: 'default' },
...signalingSystems.map((id) => ({
url: `${baseURL}/sprites/${id}/sprites`,
url: `${window.location.origin}${baseURL}/sprites/${id}/sprites`,
id,
})),
]
Expand Down
4 changes: 2 additions & 2 deletions front/src/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const MAIN_API = {
proxy_editoast: `${import.meta.env.OSRD_BACKEND_URL}/api`,
proxy_gateway: `${import.meta.env.OSRD_BACKEND_URL}`,
proxy_editoast: '/api',
proxy_gateway: '',
version: '0.0.1',
editor: {
component_identifier: { database: 'gaia', name: 'Test' },
Expand Down
1 change: 0 additions & 1 deletion front/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
OSRD_BACKEND_URL: string;
OSRD_SENTRY_DSN: string;
OSRD_SENTRY_ENVIRONMENT: string;
OSRD_GIT_DESCRIBE: string;
Expand Down