Skip to content

Commit 7396af3

Browse files
committed
add config file
1 parent b23ca8d commit 7396af3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This plugin ensures runtime config is properly initialized early in the request lifecycle
2+
export default defineNitroPlugin((nitro) => {
3+
nitro.hooks.hook('request', async (event) => {
4+
try {
5+
// Pre-load the configuration to ensure it's initialized
6+
const config = useRuntimeConfig(event);
7+
console.log('Runtime config initialized successfully:', Object.keys(config));
8+
} catch (error) {
9+
console.error('Failed to initialize runtime config:', error);
10+
}
11+
});
12+
});

0 commit comments

Comments
 (0)