Files
nobat724_front/app/robots.js
T
hamed f87110c277 refactor: remove unused components and files related to date filtering and doctor search
- Deleted Date.js and FilterDate.js components as they are no longer needed.
- Removed SearchDoctor.js component which was responsible for searching doctors.
- Cleaned up the Head component by removing references to the deleted Date and SearchDoctor components.
- Removed TurnsPage component and its associated List component, which were not utilized.
- Deleted Cards and Table components from the list directory as they were not in use.
- Removed user account related components including Tab, Head, and Form components.
- Cleaned up bank account components including List, Item, and modal components.
- Removed representation adapters and related functions that were not in use.
2026-06-25 18:14:27 +03:30

44 lines
1.1 KiB
JavaScript

import { headers } from 'next/headers';
// Get current domain from headers
function getCurrentDomain() {
const headersList = headers();
const host = headersList.get('host');
return host || 'nobat724.com';
}
// Get base URL based on current domain
function getBaseUrl(domain) {
// Remove port number if present (for development)
const cleanDomain = domain.replace(/:\d+$/, '');
// For localhost domains, use http, otherwise https
const protocol = cleanDomain.includes('localhost') ? 'http' : 'https';
return `${protocol}://${domain}`;
}
export default function robots() {
const domain = getCurrentDomain();
const baseUrl = getBaseUrl(domain);
// If DEV_MODE is TRUE, disallow all crawlers
if (process.env.DEV_MODE === 'TRUE') {
return {
rules: {
userAgent: '*',
disallow: '/',
},
};
}
// Normal behavior when DEV_MODE is FALSE or not set
return {
rules: {
userAgent: '*',
allow: '/',
disallow: ['/dashboard'],
},
sitemap: `${baseUrl}/sitemap.xml`,
};
}