Feat/azure vercel deployment - #305
Merged
Merged
Conversation
- Introduced a new utility function `getApiBaseUrl` in `apiBase.ts` to centralize the retrieval of the API base URL. - Updated all relevant components and pages to use the new `getApiBaseUrl` function instead of directly accessing environment variables. - This change improves maintainability and consistency in how the API base URL is managed throughout the application.
- Refactor Node.js setup in Azure workflow to use environment variable for version - Create deployment package for Azure deployment - Update server's package.json to specify Node.js engine version - Change default server port from 8080 to 4000 - Add health check endpoint for API monitoring
… modules and improve fallback handling
…feat/azure-vercel-deployment
| export function getApiBaseUrl(): string { | ||
| return ( | ||
| import.meta.env.VITE_API_BASE_URL || | ||
| (import.meta as any).env?.VITE_API_URL || |
There was a problem hiding this comment.
Unexpected any. Specify a different type.
| const { hostname } = new URL(first); | ||
| if (!hostname.endsWith(".vercel.app")) return null; | ||
| return hostname.replace(/\.vercel\.app$/i, ""); | ||
| } catch (_e) { |
There was a problem hiding this comment.
'_e' is defined but never used.
| ) { | ||
| return callback(null, true); | ||
| } | ||
| } catch (_e) { |
There was a problem hiding this comment.
'_e' is defined but never used.
| if (protocol === "https:" && hostname.endsWith(".vercel.app")) { | ||
| return callback(null, true); | ||
| } | ||
| } catch (_e) { |
There was a problem hiding this comment.
'_e' is defined but never used.
|
|
||
| if (!logger || typeof logger.info !== "function") { | ||
| // Extremely defensive fallback | ||
| // eslint-disable-next-line no-console |
There was a problem hiding this comment.
Unused eslint-disable directive (no problems were reported from 'no-console').
Suggested change
| // eslint-disable-next-line no-console | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This pull request introduces automated deployment pipelines for both the backend and frontend, along with a frontend refactor that centralizes API base URL configuration. These changes improve deployment reliability, environment flexibility, and long-term maintainability. In addition,
.gitignorerules were updated to prevent committing Vercel-generated build artifacts.Deployment Automation
Added
azure-deploy.ymlGitHub Actions workflow to automate backend deployments to Azure Web App.Added
vercel-deploy.ymlGitHub Actions workflow to automate frontend deployments to Vercel.Frontend Configuration Improvements
client/package.json, defining scripts, dependencies, and development tooling required for building, linting, formatting, and running the frontend application.client/.gitignoreto exclude the.verceldirectory, ensuring Vercel build artifacts are not tracked in version control.API Base URL Refactor
getApiBaseUrlutility from@/lib/apiBaseinstead of hardcoded or duplicated API URLs.Updated components include:
BazaarList.tsxBigCalendarView.tsxCalendarPopover.tsxCreateEventForm.tsxCreateGymSessionDialog.tsxCreatePrivilegedUserForm.tsxEditGymSessionDialog.tsxEventCard.tsxEventFeedbackDialog.tsxEventListItem.tsxEventSearch.tsx