Alireza
Alireza
NNuxt
Created by Alireza on 9/7/2024 in #❓・help
Example of updating app.config at runtime
Doc says app.config is reactive and can be changed at runtime. The docs does not provide any examples though. https://nuxt.com/docs/guide/directory-structure/app-config I am looking for an example of how to do that and what are the use cases of this feature. For example, if we have a color: "#fff" in the app.config, can it be changed at the runtime after fetching the value from the database after the user login? like color.value = userColor It would be also nice if anyone could point to a GitHub repo that uses this or even how to search GitHub to find such a use case.
2 replies
NNuxt
Created by Alireza on 3/18/2024 in #❓・help
how to define types for runtimeConfig keys?
example:
runtimeConfig: {
public: {
//-> this can be of type 'apple' | 'banana' | 'cherry'
fruit: 'apple',
}
}
runtimeConfig: {
public: {
//-> this can be of type 'apple' | 'banana' | 'cherry'
fruit: 'apple',
}
}
2 replies
NNuxt
Created by Alireza on 7/2/2023 in #❓・help
Is it possible to select/define which server middlewares should be run on a specific server route?
For example I have a collection of routes under /server/api/user and I need all of them to run /server/middleware/auth.ts . How do you go about it?
5 replies
NNuxt
Created by Alireza on 2/16/2023 in #❓・help
Recommended place to put custom types
I am putting my custom type defs in the /utils directory. Is there a better place to put them? What do you do usually?
6 replies