Feature/32 deploy api as azure function app (#34)

* changing api to azure function app

* changing api to azure function app

* changing api to azure function app

* changing api to azure function app

* changing api to azure function app

* changing api to azure function app

* changing api to azure container app
This commit was merged in pull request #34.
This commit is contained in:
2024-11-30 04:51:16 +00:00
committed by GitHub
parent f70e8cce2a
commit cd21f5170f
17 changed files with 395 additions and 207 deletions

View File

@@ -12,36 +12,36 @@ const App: React.FC<unknown> = () => {
const httpClient: AxiosInstance = useHttpClient();
const appContext = useAppContext();
useEffect(() => {
const getFeatureFlags = async () => {
try {
const featureFlagKeys: string = 'flying-pilots';
const response: AxiosResponse = await httpClient.get(
`api/featureFlags?keys=${featureFlagKeys}&label=${import.meta.env.MODE}`
);
const featureFlags: { key: string; enabled: boolean }[] = response.data;
// useEffect(() => {
// const getFeatureFlags = async () => {
// try {
// const featureFlagKeys: string = 'flying-pilots';
// const response: AxiosResponse = await httpClient.get(
// `api/featureFlags?keys=${featureFlagKeys}&label=${import.meta.env.MODE}`
// );
// const featureFlags: { key: string; enabled: boolean }[] = response.data;
if (featureFlags.length > 0) {
appContext.dispatch({
type: 'SET_FEATURE_FLAGS',
payload: featureFlags
});
}
} catch (error) {
console.log(error);
}
};
// if (featureFlags.length > 0) {
// appContext.dispatch({
// type: 'SET_FEATURE_FLAGS',
// payload: featureFlags
// });
// }
// } catch (error) {
// console.log(error);
// }
// };
getFeatureFlags();
}, []);
// getFeatureFlags();
// }, []);
return (
<div>
<SiteNav />
<Routes>
{useFeatureFlag('flying-pilots')?.enabled && (
<Route path="/pilots" element={<Pilots />} />
)}
{/* {useFeatureFlag('flying-pilots')?.enabled && ( */}
<Route path="/pilots" element={<Pilots />} />
{/* )} */}
<Route path="/" element={<Logbook />} />
</Routes>
</div>