refactor(frontend): Remove '/api' prefix from all API calls to align with backend URL convention
- Updated all API endpoint strings in 'frontend/src' (via sed and manual fixes) to remove the '/api/' prefix. - Manually fixed 'Timeline.tsx' absolute URLs to use the 'api' subdomain and correct path. - Manually fixed 'useAuth.ts' logout fetch URLs. - Updated 'HelpApiDocs.tsx' sandbox URL. - This change, combined with the backend URL update, fully transitions the application to use subdomain-based routing (e.g., 'http://api.lvh.me:8000/resource/') instead of path-prefix routing (e.g., 'http://api.lvh.me:8000/api/resource/').
This commit is contained in:
@@ -252,9 +252,10 @@ const AppContent: React.FC = () => {
|
||||
const isRootDomainForUnauthUser = currentHostname === baseDomain || currentHostname === 'localhost';
|
||||
|
||||
if (!isRootDomainForUnauthUser) {
|
||||
// Redirect to root domain login
|
||||
// Redirect to root domain login (preserve port)
|
||||
const protocol = window.location.protocol;
|
||||
window.location.href = `${protocol}//${baseDomain}/login`;
|
||||
const port = window.location.port ? `:${window.location.port}` : '';
|
||||
window.location.href = `${protocol}//${baseDomain}${port}/login`;
|
||||
return <LoadingScreen />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user