Skip to content

Commit e473561

Browse files
feat: add Hyperspace Portal integration (#232)
1 parent b8f9d79 commit e473561

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

server.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,23 @@ const isLocalDev = process.argv.includes('--local-dev');
3434

3535
const __filename = fileURLToPath(import.meta.url);
3636
const __dirname = path.dirname(__filename);
37-
const frontendConfigLocation = isLocalDev ? 'public/frontend-config.json' : 'dist/client/frontend-config.json';
3837

38+
// Make frontend configuration available (frontend-config.json)
39+
const frontendConfigLocation = isLocalDev ? 'public/frontend-config.json' : 'dist/client/frontend-config.json';
3940
if (process.env.FRONTEND_CONFIG_PATH !== undefined && process.env.FRONTEND_CONFIG_PATH.length > 0) {
4041
console.log('FRONTEND_CONFIG_PATH is specified. Will copy the frontend-config from there.');
4142
console.log(` Copying ${process.env.FRONTEND_CONFIG_PATH} to ${frontendConfigLocation}`);
4243
copyFileSync(process.env.FRONTEND_CONFIG_PATH, frontendConfigLocation);
4344
}
4445

46+
// Make hyperspace portal configuration available (hyperspace-portal-config.json)
47+
if (!isLocalDev && process.env.HYPERSPACE_PORTAL_CONFIG_PATH !== undefined && process.env.HYPERSPACE_PORTAL_CONFIG_PATH.length > 0) {
48+
const hyperspacePortalConfigLocation = 'dist/client/hyperspace-portal-config.json';
49+
console.log('HYPERSPACE_PORTAL_CONFIG_PATH is specified. Will copy the hyperspace-portal-config from there.');
50+
console.log(` Copying ${process.env.HYPERSPACE_PORTAL_CONFIG_PATH} to ${hyperspacePortalConfigLocation}`);
51+
copyFileSync(process.env.HYPERSPACE_PORTAL_CONFIG_PATH, hyperspacePortalConfigLocation);
52+
}
53+
4554
const fastify = Fastify({
4655
logger: true,
4756
});

0 commit comments

Comments
 (0)