We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f3ad08 commit 8c0026aCopy full SHA for 8c0026a
src/app/api/flags/route.ts
@@ -0,0 +1,16 @@
1
+import "@vercel/flags/next";
2
+
3
+export async function GET() {
4
+ const isEnabled = unstable_flag("WeatherWidgetEnabled", false);
5
+ return new Response(JSON.stringify({ isEnabled }), {
6
+ headers: { "Content-Type": "application/json" },
7
+ });
8
+}
9
+function unstable_flag(flagName: string, defaultValue: boolean): boolean {
10
+ // Simulate a feature flag check. In a real-world scenario, this might query a database or an external service.
11
+ const featureFlags: Record<string, boolean> = {
12
+ WeatherWidgetEnabled: true, // Example flag
13
+ };
14
15
+ return featureFlags[flagName] ?? defaultValue;
16
0 commit comments