Skip to content

Commit 6ce0521

Browse files
authored
Merge pull request #3243 from Redis-Insight/bugfix/RI-5628-fix-windows-path-join
Use posix join for combining paths
2 parents f60e8c2 + 556aa0e commit 6ce0521

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

redisinsight/api/config/default.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { join } from 'path';
1+
import { join, posix } from 'path';
22
import * as os from 'os';
33
import { trim } from 'lodash';
44
import { version } from '../package.json';
@@ -18,15 +18,15 @@ const defaultsDir = process.env.RI_BUILD_TYPE === 'ELECTRON' && process['resourc
1818

1919
const proxyPath = trim(process.env.RI_PROXY_PATH, '/');
2020

21-
const customPluginsUri = join('/', proxyPath, 'plugins');
22-
const staticUri = join('/', proxyPath, 'static');
23-
const tutorialsUri = join('/', proxyPath, 'static', 'tutorials');
24-
const customTutorialsUri = join('/', proxyPath, 'static', 'custom-tutorials');
25-
const contentUri = join('/', proxyPath, 'static', 'content');
26-
const defaultPluginsUri = join('/', proxyPath, 'static', 'plugins');
27-
const pluginsAssetsUri = join('/', proxyPath, 'static', 'resources', 'plugins');
21+
const customPluginsUri = posix.join('/', proxyPath, 'plugins');
22+
const staticUri = posix.join('/', proxyPath, 'static');
23+
const tutorialsUri = posix.join('/', proxyPath, 'static', 'tutorials');
24+
const customTutorialsUri = posix.join('/', proxyPath, 'static', 'custom-tutorials');
25+
const contentUri = posix.join('/', proxyPath, 'static', 'content');
26+
const defaultPluginsUri = posix.join('/', proxyPath, 'static', 'plugins');
27+
const pluginsAssetsUri = posix.join('/', proxyPath, 'static', 'resources', 'plugins');
2828

29-
const socketPath = join('/', proxyPath, 'socket.io');
29+
const socketPath = posix.join('/', proxyPath, 'socket.io');
3030
const dataDir = process.env.RI_BUILD_TYPE === 'ELECTRON' && process['resourcesPath']
3131
? join(process['resourcesPath'], 'data')
3232
: join(__dirname, '..', 'data');

redisinsight/api/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { join } from 'path';
1+
import { posix } from 'path';
22
import 'dotenv/config';
33
import { NestFactory } from '@nestjs/core';
44
import { SwaggerModule } from '@nestjs/swagger';
@@ -46,7 +46,7 @@ export default async function bootstrap(apiPort?: number): Promise<IApp> {
4646
if (process.env.RI_APP_TYPE !== 'electron') {
4747
let prefix = serverConfig.globalPrefix;
4848
if (serverConfig.proxyPath) {
49-
prefix = join(serverConfig.proxyPath, prefix);
49+
prefix = posix.join(serverConfig.proxyPath, prefix);
5050
}
5151

5252
app.setGlobalPrefix(prefix, { exclude: ['/'] });

0 commit comments

Comments
 (0)