ibrahimlasfar commited on
Commit
55bfca2
ยท
1 Parent(s): 000cbfa

Add privacy policy and terms of service pages for Google OAuth verification

Browse files
Files changed (1) hide show
  1. server.js +10 -36
server.js CHANGED
@@ -4073,42 +4073,16 @@ app.get('/terms', (req, res) => {
4073
 
4074
  // Sitemap.xml
4075
  app.get('/sitemap.xml', (req, res) => {
4076
- const baseUrl = process.env.BASE_URL || 'https://mgzon-server.hf.space';
4077
- const sitemap = `<?xml version="1.0" encoding="UTF-8"?>
4078
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
4079
- <url>
4080
- <loc>${baseUrl}/</loc>
4081
- <lastmod>${new Date().toISOString().split('T')[0]}</lastmod>
4082
- <changefreq>daily</changefreq>
4083
- <priority>1.0</priority>
4084
- </url>
4085
- <url>
4086
- <loc>${baseUrl}/api-docs</loc>
4087
- <lastmod>${new Date().toISOString().split('T')[0]}</lastmod>
4088
- <changefreq>weekly</changefreq>
4089
- <priority>0.8</priority>
4090
- </url>
4091
- <url>
4092
- <loc>${baseUrl}/privacy</loc>
4093
- <lastmod>${new Date().toISOString().split('T')[0]}</lastmod>
4094
- <changefreq>monthly</changefreq>
4095
- <priority>0.5</priority>
4096
- </url>
4097
- <url>
4098
- <loc>${baseUrl}/terms</loc>
4099
- <lastmod>${new Date().toISOString().split('T')[0]}</lastmod>
4100
- <changefreq>monthly</changefreq>
4101
- <priority>0.5</priority>
4102
- </url>
4103
- <url>
4104
- <loc>${baseUrl}/api/health</loc>
4105
- <lastmod>${new Date().toISOString().split('T')[0]}</lastmod>
4106
- <changefreq>hourly</changefreq>
4107
- <priority>0.3</priority>
4108
- </url>
4109
- </urlset>`;
4110
- res.header('Content-Type', 'application/xml');
4111
- res.send(sitemap);
4112
  });
4113
 
4114
  // Robots.txt
 
4073
 
4074
  // Sitemap.xml
4075
  app.get('/sitemap.xml', (req, res) => {
4076
+ const filePath = path.join(__dirname, 'public', 'sitemap.xml');
4077
+ if (fs.existsSync(filePath)) {
4078
+ res.sendFile(filePath);
4079
+ } else {
4080
+ // ุงู„ูƒูˆุฏ ุงู„ุฏูŠู†ุงู…ูŠูƒูŠ ุงู„ู„ูŠ ุนู†ุฏูƒ
4081
+ const baseUrl = process.env.BASE_URL || 'https://mgzon-server.hf.space';
4082
+ const sitemap = `...`;
4083
+ res.header('Content-Type', 'application/xml');
4084
+ res.send(sitemap);
4085
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4086
  });
4087
 
4088
  // Robots.txt