We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 644f690 commit c06aa53Copy full SHA for c06aa53
server/plugins/1.config-loader.ts
@@ -0,0 +1,17 @@
1
+export default defineNitroPlugin(async (nitroApp) => {
2
+ const localConfig = getLocalConfig()
3
+
4
+ if (!localConfig) {
5
+ console.error('Config not loaded!')
6
+ return
7
+ }
8
9
+ // Provide full config to backend
10
+ const storage = useStorage()
11
+ await storage.setItem('services', extractServicesFromConfig(localConfig))
12
13
+ // Provide safely config to frontend
14
+ nitroApp.hooks.hook('site-config:init', ({ siteConfig }) => {
15
+ siteConfig.push(extractSafelyConfig(localConfig))
16
+ })
17
+})
0 commit comments