Skip to content

Commit 2ee8a4d

Browse files
Merge pull request #1988 from RedisInsight/bugfix/RI-4394-Bind_backend_to_127.0.0.1_interface
add listen interface for be server
2 parents 6f5312b + 12d4284 commit 2ee8a4d

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

configs/webpack.config.main.prod.babel.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export default merge(baseConfig, {
6666
SERVER_TLS_KEY: process.env.SERVER_TLS_KEY || '',
6767
APP_FOLDER_NAME: process.env.APP_FOLDER_NAME || '',
6868
UPGRADES_LINK: process.env.UPGRADES_LINK || '',
69+
RI_HOSTNAME: '127.0.0.1',
6970
BUILD_TYPE: 'ELECTRON',
7071
APP_VERSION: version,
7172
AWS_BUCKET_NAME: 'AWS_BUCKET_NAME' in process.env ? process.env.AWS_BUCKET_NAME : '',

configs/webpack.config.main.stage.babel.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default merge(mainProdConfig, {
2626
SERVER_TLS_KEY: process.env.SERVER_TLS_KEY || '',
2727
APP_FOLDER_NAME: process.env.APP_FOLDER_NAME || '',
2828
UPGRADES_LINK: process.env.UPGRADES_LINK || '',
29+
RI_HOSTNAME: '127.0.0.1',
2930
BUILD_TYPE: 'ELECTRON',
3031
APP_VERSION: version,
3132
AWS_BUCKET_NAME: 'AWS_BUCKET_NAME' in process.env ? process.env.AWS_BUCKET_NAME : '',

redisinsight/api/config/default.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default {
3939
},
4040
server: {
4141
env: 'development',
42+
listenInterface: process.env.RI_HOSTNAME ?? '0.0.0.0',
4243
port: 5000,
4344
docPrefix: 'api/docs',
4445
globalPrefix: 'api',

redisinsight/api/src/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ import { AppModule } from './app.module';
1212
import SWAGGER_CONFIG from '../config/swagger';
1313
import LOGGER_CONFIG from '../config/logger';
1414

15+
const serverConfig = get('server');
16+
1517
export default async function bootstrap(): Promise<Function> {
1618
await migrateHomeFolder();
1719

18-
const serverConfig = get('server');
1920
const port = process.env.API_PORT || serverConfig.port;
2021
const logger = WinstonModule.createLogger(LOGGER_CONFIG);
2122

@@ -47,7 +48,7 @@ export default async function bootstrap(): Promise<Function> {
4748

4849
const logFileProvider = app.get(LogFileProvider);
4950

50-
await app.listen(port);
51+
await app.listen(port, serverConfig.listenInterface);
5152
logger.log({
5253
message: `Server is running on http(s)://localhost:${port}`,
5354
context: 'bootstrap',

0 commit comments

Comments
 (0)