1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

chore: streaming spike (#8907)

We need this PR to correctly set up CORS for streaming-related endpoints
in our spike and add the flag to our types.

---------

Co-authored-by: kwasniew <kwasniewski.mateusz@gmail.com>
This commit is contained in:
Nuno Góis 2024-12-03 12:15:09 +00:00 committed by GitHub
parent 3879821396
commit 263aad4248
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View File

@ -112,6 +112,10 @@ export default async function getApp(
`${baseUriPath}/api/frontend*`,
corsOriginMiddleware(services, config),
);
app.options(
`${baseUriPath}/api/streaming*`,
corsOriginMiddleware(services, config),
);
app.use(baseUriPath, patMiddleware(config, services));

View File

@ -59,7 +59,8 @@ export type IFlagKey =
| 'showUserDeviceCount'
| 'deleteStaleUserSessions'
| 'memorizeStats'
| 'licensedUsers';
| 'licensedUsers'
| 'streaming';
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
@ -279,6 +280,10 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_FLAG_LICENSED_USERS,
false,
),
streaming: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_STREAMING,
false,
),
};
export const defaultExperimentalOptions: IExperimentalOptions = {