Skip to content
Snippets Groups Projects
Commit d9cf398b authored by Andrey Azov's avatar Andrey Azov
Browse files

Use PUBLIC_PATH environment variable when building urls to images

parent e8043a39
No related branches found
No related tags found
No related merge requests found
Pipeline #182179 passed with stages
in 1 minute and 31 seconds
......@@ -5,6 +5,7 @@ stages:
variables:
DOCKER_IMAGE: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}
DOCKER_TLS_CERTDIR: ""
PUBLIC_PATH: /api/docs
.build:
stage: build
......
......@@ -3,6 +3,7 @@ import path from 'path';
const host = process.env.HOST || 'http://127.0.0.1:3000';
const isProduction = process.env.NODE_ENV === 'production';
const isBuildingDocs = process.env.NODE_ENV === 'build-docs';
const publicPath = process.env.PUBLIC_PATH || '/api';
const docsPath = path.resolve(__dirname, 'docs');
const buildPath = isProduction
......@@ -23,7 +24,7 @@ export default {
docsPath,
articlesPath: path.join(docsPath, 'article'),
videosPath: path.join(docsPath, 'video'),
publicPath: isProduction ? '/api/docs' : '/api', // FIXME: we'll need to rely on the environment variable other than NODE_ENV for this
publicPath,
indexDirectory,
articlesIndexName,
articlesIndexPath: path.join(indexDirectory, articlesIndexName),
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment