const process = { env: { API_KEY_PREFIX: 'vf_live_' } }; // Now it should be vf_live_ const generatedKey = 'vf_live_' + '1234567890abcdef12345678'; const prefix = process.env.API_KEY_PREFIX || 'vf_live_'; const testPrefix = 'vf_test_'; console.log(`Env Prefix: ${prefix}`); console.log(`Generated Key: ${generatedKey}`); if (!generatedKey.startsWith(prefix) && !generatedKey.startsWith(testPrefix)) { console.log("FAIL: Key would be rejected by middleware"); process.exit(1); } else { console.log("PASS: Key would be accepted"); }