diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..99d2567 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,38 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch via NPM with Kubernetes", + "request": "launch", + "runtimeArgs": [ + "dev" + ], + "runtimeExecutable": "yarn", + "skipFiles": [ + "/**" + ], + "envFile": "${workspaceFolder}/.env", + "type": "node", + "preLaunchTask": "bridge-to-kubernetes.resource", + "env": { + "GRPC_DNS_RESOLVER": "native" + } + }, + { + "name": "Launch via NPM", + "request": "launch", + "runtimeArgs": [ + "dev" + ], + "envFile": "${workspaceFolder}/.env", + "runtimeExecutable": "yarn", + "skipFiles": [ + "/**" + ], + "type": "node" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..31b8fec --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,17 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "bridge-to-kubernetes.resource", + "type": "bridge-to-kubernetes.resource", + "resource": "toches", + "resourceType": "service", + "ports": [ + 8080 + ], + "targetCluster": "microk8s-cluster", + "targetNamespace": "beta", + "useKubernetesServiceEnvironmentVariables": true + } + ] +} \ No newline at end of file diff --git a/src/modules/video/helpers/serializeVideoMediaAsset.ts b/src/modules/video/helpers/serializeVideoMediaAsset.ts index d8fa8cf..9bdf6a6 100644 --- a/src/modules/video/helpers/serializeVideoMediaAsset.ts +++ b/src/modules/video/helpers/serializeVideoMediaAsset.ts @@ -1,3 +1,4 @@ +import { MEDIA_SERVER_BASE_URL } from "../../core/constants" import { VideoMediaAssetData } from "../models/videoModel" export const getObjectURL = (locator?: string) => { @@ -6,9 +7,8 @@ export const getObjectURL = (locator?: string) => { const [scheme, ...rest] = locator.split(":") if (scheme === "S3") { - const mediaUrl = process.env["FK_MEDIA"] ?? "" const [bucket, ...path] = rest - return `${mediaUrl}/${bucket}/${path.join(":")}` + return `${MEDIA_SERVER_BASE_URL}/${bucket}/${path.join(":")}` } else if (scheme === "legacy") { return "https://upload.frikanalen.no/media/" + rest.join(":") }