chore: random quick fixes

This commit is contained in:
Aarnav Tale
2025-12-04 04:11:52 -05:00
parent a824ea3dcf
commit e09c5760af
4 changed files with 32 additions and 7 deletions
+19 -2
View File
@@ -1,5 +1,5 @@
import { join } from 'node:path';
import { versions } from 'node:process';
import { exit, versions } from 'node:process';
import { createHonoServer } from 'react-router-hono-server/node';
import log from '~/utils/log';
import { loadIntegration } from './config/integration';
@@ -19,7 +19,17 @@ declare global {
// This module contains a side-effect because everything running here
// exists for the lifetime of the process, making it appropriate.
log.info('server', 'Running Node.js %s', versions.node);
const config = await loadConfig();
let config: HeadplaneConfig;
try {
config = await loadConfig();
} catch (error) {
if (error instanceof ConfigError) {
log.error('server', 'Unable to load configuration: %s', error.message);
}
exit(1);
}
const db = await createDbClient(join(config.server.data_path, 'hp_persist.db'));
const agents = await createHeadplaneAgent(
@@ -39,6 +49,8 @@ const hsApi = await createHeadscaleInterface(
export type LoadContext = typeof appLoadContext;
import 'react-router';
import { HeadplaneConfig } from './config/config-schema';
import { ConfigError } from './config/error';
import { createOidcConnector } from './web/oidc-connector';
declare module 'react-router' {
@@ -92,6 +104,11 @@ export default createHonoServer({
});
},
serveStaticOptions: {
publicAssets: {
// This is part of our monkey-patch for react-router-hono-server
// To see the first part, go to the patches/ directory.
rewriteRequestPath: (path) => path.replace(`${__PREFIX__}`, ''),
},
clientAssets: {
// This is part of our monkey-patch for react-router-hono-server
// To see the first part, go to the patches/ directory.