Ver código fonte

Implémentation du SEO

DESKTOP-SMCIPAV\falko 6 meses atrás
pai
commit
f77849bead

+ 10 - 82
angular-client/angular.json

@@ -26,8 +26,7 @@
             "assets": [
               "src/favicon.ico",
               "src/assets",
-              "src/robots.txt",   
-              "src/sitemap.xml"   
+              "src/robots.txt"
             ],
             "styles": [
               "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
@@ -55,7 +54,7 @@
               "budgets": [
                 {
                   "type": "initial",
-                  "maximumWarning": "2mb",
+                  "maximumWarning": "2.5mb",
                   "maximumError": "5mb"
                 },
                 {
@@ -67,71 +66,11 @@
             }
           }
         },
-        "serve": {
-          "builder": "@angular-devkit/build-angular:dev-server",
-          "options": {
-            "browserTarget": "fatboar:build"
-          },
-          "configurations": {
-            "production": {
-              "browserTarget": "fatboar:build:production"
-            }
-          }
-        },
-        "extract-i18n": {
-          "builder": "@angular-devkit/build-angular:extract-i18n",
-          "options": {
-            "browserTarget": "fatboar:build"
-          }
-        },
-        "test": {
-          "builder": "@angular-devkit/build-angular:karma",
-          "options": {
-            "main": "src/test.ts",
-            "polyfills": "src/polyfills.ts",
-            "tsConfig": "tsconfig.spec.json",
-            "karmaConfig": "karma.conf.js",
-            "assets": [
-              "src/favicon.ico",
-              "src/assets"
-            ],
-            "styles": [
-              "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
-              "src/styles.scss"
-            ],
-            "scripts": []
-          }
-        },
-        "lint": {
-          "builder": "@angular-devkit/build-angular:tslint",
-          "options": {
-            "tsConfig": [
-              "tsconfig.app.json",
-              "tsconfig.spec.json",
-              "e2e/tsconfig.json"
-            ],
-            "exclude": [
-              "**/node_modules/**"
-            ]
-          }
-        },
-        "e2e": {
-          "builder": "@angular-devkit/build-angular:protractor",
-          "options": {
-            "protractorConfig": "e2e/protractor.conf.js",
-            "devServerTarget": "fatboar:serve"
-          },
-          "configurations": {
-            "production": {
-              "devServerTarget": "fatboar:serve:production"
-            }
-          }
-        },
         "server": {
           "builder": "@angular-devkit/build-angular:server",
           "options": {
             "outputPath": "dist/fatboar/server",
-            "main": "server.ts",
+            "main": "src/main.server.ts",
             "tsConfig": "tsconfig.server.json"
           },
           "configurations": {
@@ -148,26 +87,19 @@
             }
           }
         },
-        "serve-ssr": {
-          "builder": "@nguniversal/builders:ssr-dev-server",
-          "options": {
-            "browserTarget": "fatboar:build",
-            "serverTarget": "fatboar:server"
-          },
-          "configurations": {
-            "production": {
-              "browserTarget": "fatboar:build:production",
-              "serverTarget": "fatboar:server:production"
-            }
-          }
-        },
         "prerender": {
           "builder": "@nguniversal/builders:prerender",
           "options": {
             "browserTarget": "fatboar:build:production",
             "serverTarget": "fatboar:server:production",
             "routes": [
-              "/"
+              "/",
+              "/home",
+              "/register",
+              "/cgu",
+              "/mention-legales",
+              "/politique-de-confidentialite",
+              "/contact"
             ]
           },
           "configurations": {
@@ -176,9 +108,5 @@
         }
       }
     }
-  },
-  "defaultProject": "fatboar",
-  "cli": {
-    "analytics": false
   }
 }

+ 16 - 3
angular-client/dist/fatboar/browser/index.html

@@ -1,15 +1,28 @@
 <!doctype html>
-<html lang="en">
+<html lang="fr">
 <head>
   <meta charset="utf-8">
   <title>Fatboar</title>
   <base href="/">
   <meta name="viewport" content="width=device-width, initial-scale=1">
+  <meta name="description" content="Fatboar - Participez à des concours exclusifs pour gagner un Range Rover, des menus, burgers, desserts et réductions.">
+  <meta name="keywords" content="fatboar, concours, range rover, burgers, menus, réductions, restauration">
+  <meta name="robots" content="index, follow">
+  <meta property="og:title" content="Fatboar - Jeu-Concours">
+  <meta property="og:description" content="Tentez votre chance pour gagner un Range Rover et d’autres prix avec Fatboar.">
+  <meta property="og:image" content="https://angular-preprod.foodgame.fr/assets/fatboar-og.jpg">
+  <meta property="og:url" content="https://angular-preprod.foodgame.fr">
+  <meta property="og:type" content="website">
+  <meta name="twitter:card" content="summary_large_image">
+  <meta name="twitter:title" content="Fatboar - Jeu-Concours">
+  <meta name="twitter:description" content="Tentez votre chance pour gagner un Range Rover et d’autres prix avec Fatboar.">
+  <meta name="twitter:image" content="https://angular-preprod.foodgame.fr/assets/fatboar-og.jpg">
+  <link rel="canonical" href="https://angular-preprod.foodgame.fr">
   <link rel="icon" type="image/x-icon" href="favicon.ico">
   <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" rel="stylesheet">
   <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
 <link rel="stylesheet" href="styles.ef582ae2929323c4e400.css"></head>
 <body class="mat-typography">
   <app-root></app-root>
-<script src="runtime-es2015.17457c14264390561f33.js" type="module"></script><script src="runtime-es5.17457c14264390561f33.js" nomodule defer></script><script src="polyfills-es5.4e4feefe344275ae35b2.js" nomodule defer></script><script src="polyfills-es2015.52e50f90e3cb22b88a9c.js" type="module"></script><script src="main-es2015.c71be015649d5f021a46.js" type="module"></script><script src="main-es5.c71be015649d5f021a46.js" nomodule defer></script></body>
-</html>
+<script src="runtime-es2015.17457c14264390561f33.js" type="module"></script><script src="runtime-es5.17457c14264390561f33.js" nomodule defer></script><script src="polyfills-es5.4e4feefe344275ae35b2.js" nomodule defer></script><script src="polyfills-es2015.52e50f90e3cb22b88a9c.js" type="module"></script><script src="main-es2015.b9138acecc230ce8d4a7.js" type="module"></script><script src="main-es5.b9138acecc230ce8d4a7.js" nomodule defer></script></body>
+</html>

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
angular-client/dist/fatboar/browser/main-es2015.b9138acecc230ce8d4a7.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1
angular-client/dist/fatboar/browser/main-es2015.c71be015649d5f021a46.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
angular-client/dist/fatboar/browser/main-es5.c71be015649d5f021a46.js


+ 10 - 4
angular-client/dist/fatboar/browser/robots.txt

@@ -1,6 +1,12 @@
 User-agent: *
-Disallow: /admin/
-Disallow: /login/
 Allow: /
-
-Sitemap: https://angular-preprod.foodgame.fr/sitemap.xml
+Disallow: /login
+Disallow: /login/lost-password
+Disallow: /login/reset-password
+Disallow: /users
+Disallow: /statistique
+Disallow: /emailing
+Disallow: /assistance
+Disallow: /auth
+Disallow: /profil
+Sitemap: https://angular-preprod.foodgame.fr/sitemap.xml

+ 0 - 89
angular-client/dist/fatboar/browser/sitemap.xml

@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/</loc>
-        <changefreq>daily</changefreq>
-        <priority>1.0</priority>
-    </url>
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/login</loc>
-        <changefreq>weekly</changefreq>
-        <priority>0.8</priority>
-    </url>
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/login/lost-password</loc>
-        <changefreq>weekly</changefreq>
-        <priority>0.8</priority>
-    </url>
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/login/reset-password/:token</loc>
-        <changefreq>weekly</changefreq>
-        <priority>0.8</priority>
-    </url>
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/register</loc>
-        <changefreq>weekly</changefreq>
-        <priority>0.8</priority>
-    </url>
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/cgu</loc>
-        <changefreq>monthly</changefreq>
-        <priority>0.6</priority>
-    </url>
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/mention-legales</loc>
-        <changefreq>monthly</changefreq>
-        <priority>0.6</priority>
-    </url>
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/politique-de-confidentialite</loc>
-        <changefreq>monthly</changefreq>
-        <priority>0.6</priority>
-    </url>
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/admin</loc>
-        <changefreq>weekly</changefreq>
-        <priority>0.8</priority>
-    </url>
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/users</loc>
-        <changefreq>weekly</changefreq>
-        <priority>0.8</priority>
-    </url>
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/statistique</loc>
-        <changefreq>weekly</changefreq>
-        <priority>0.8</priority>
-    </url>
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/emailing</loc>
-        <changefreq>weekly</changefreq>
-        <priority>0.8</priority>
-    </url>
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/assistance</loc>
-        <changefreq>weekly</changefreq>
-        <priority>0.8</priority>
-    </url>
-    <url>
-        <loc>https://angular-preprod.foodgame.fr/contact</loc>
-        <changefreq>monthly</changefreq>
-        <priority>0.6</priority>
-    </url>
-
-    <!-- Autres routes -->
-    
-    <!-- Auth -->
-    <url><loc>https://angular-preprod.foodgame.fr/auth</loc></url>
-
-    <!-- Tirage -->
-    <url><loc>https://angular-preprod.foodgame.fr/tirage</loc></url>
-
-    <!-- Profil -->
-    <url><loc>https://angular-preprod.foodgame.fr/profil</loc></url>
-
-    <!-- Not Found -->
-    <!-- Cette route n'a pas besoin d'être incluse dans le sitemap -->
-    
-</urlset>
-

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
angular-client/dist/fatboar/server/main.js


+ 8 - 80
angular-client/server.ts

@@ -6,13 +6,9 @@ import { AppServerModule } from './src/main.server';
 import { APP_BASE_HREF } from '@angular/common';
 import { existsSync } from 'fs';
 
-// Polyfills pour le SSR
 const domino = require('domino');
 const fs = require('fs');
 const path = require('path');
-// const distFolder = join(process.cwd(), 'dist/fatboar/browser');
-// const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index';
-// const template = fs.readFileSync(join(distFolder, indexHtml)).toString();
 const distFolder = join(process.cwd(), 'dist/fatboar/browser');
 const indexHtml = existsSync(join(distFolder, 'index.html')) ? 'index.html' : 'index';
 const template = fs.readFileSync(join(distFolder, indexHtml)).toString();
@@ -23,11 +19,9 @@ global['document'] = win.document;
 global['navigator'] = win.navigator;
 global['CSS'] = null;
 
-// The Express app is exported so that it can be used by serverless Functions.
 export function app() {
   const server = express();
 
-  // Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)
   server.engine('html', ngExpressEngine({
     bootstrap: AppServerModule,
   }));
@@ -35,16 +29,18 @@ export function app() {
   server.set('view engine', 'html');
   server.set('views', distFolder);
 
-  // Example Express Rest API endpoints
-  // server.get('/api/**', (req, res) => { });
-  // Serve static files from /browser
   server.get('*.*', express.static(distFolder, {
     maxAge: '1y'
   }));
 
-  // All regular routes use the Universal engine
   server.get('*', (req, res) => {
-    res.render(indexHtml, { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });
+    res.render(indexHtml, {
+      req,
+      providers: [
+        { provide: APP_BASE_HREF, useValue: req.baseUrl },
+        { provide: 'CANONICAL_URL', useValue: `https://angular-preprod.foodgame.fr${req.originalUrl}` }
+      ]
+    });
   });
 
   return server;
@@ -52,17 +48,12 @@ export function app() {
 
 function run() {
   const port = process.env.PORT || 4000;
-
-  // Start up the Node server
   const server = app();
   server.listen(port, () => {
     console.log(`Node Express server listening on http://localhost:${port}`);
   });
 }
 
-// Webpack will replace 'require' with '__webpack_require__'
-// '__non_webpack_require__' is a proxy to Node 'require'
-// The below code is to ensure that the server is run only when not requiring the bundle.
 declare const __non_webpack_require__: NodeRequire;
 const mainModule = __non_webpack_require__.main;
 const moduleFilename = mainModule && mainModule.filename || '';
@@ -70,67 +61,4 @@ if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
   run();
 }
 
-export * from './src/main.server';
-
-
-
-// import 'zone.js/dist/zone-node';
-
-// import { ngExpressEngine } from '@nguniversal/express-engine';
-// import * as express from 'express';
-// import { join } from 'path';
-
-// import { AppServerModule } from './src/main.server';
-// import { APP_BASE_HREF } from '@angular/common';
-// import { existsSync } from 'fs';
-
-// // The Express app is exported so that it can be used by serverless Functions.
-// export function app() {
-//   const server = express();
-//   const distFolder = join(process.cwd(), 'dist/fatboar/browser');
-//   const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index';
-
-//   // Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)
-//   server.engine('html', ngExpressEngine({
-//     bootstrap: AppServerModule,
-//   }));
-
-//   server.set('view engine', 'html');
-//   server.set('views', distFolder);
-
-//   // Example Express Rest API endpoints
-//   // server.get('/api/**', (req, res) => { });
-//   // Serve static files from /browser
-//   server.get('*.*', express.static(distFolder, {
-//     maxAge: '1y'
-//   }));
-
-//   // All regular routes use the Universal engine
-//   server.get('*', (req, res) => {
-//     res.render(indexHtml, { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });
-//   });
-
-//   return server;
-// }
-
-// function run() {
-//   const port = process.env.PORT || 4000;
-
-//   // Start up the Node server
-//   const server = app();
-//   server.listen(port, () => {
-//     console.log(`Node Express server listening on http://localhost:${port}`);
-//   });
-// }
-
-// // Webpack will replace 'require' with '__webpack_require__'
-// // '__non_webpack_require__' is a proxy to Node 'require'
-// // The below code is to ensure that the server is run only when not requiring the bundle.
-// declare const __non_webpack_require__: NodeRequire;
-// const mainModule = __non_webpack_require__.main;
-// const moduleFilename = mainModule && mainModule.filename || '';
-// if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
-//   run();
-// }
-
-// export * from './src/main.server';
+export * from './src/main.server';

+ 255 - 39
angular-client/src/app/app-routing.module.ts

@@ -1,54 +1,270 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { HomeComponent } from './components/home/home.component';
+import { LoginComponent } from './components/login/login.component';
 import { ResetPasswordComponent } from './components/login/reset-password/reset-password.component';
 import { LostPasswordComponent } from './components/login/lost-password/lost-password.component';
-import { AssistanceComponent } from './components/admin/assistance/assistance.component';
-import { PolitiqueConfidentialiteComponent } from './components/shared/politique-confidentialite/politique-confidentialite.component';
-import { MentionsLegalesComponent } from './components/shared/mentions-legales/mentions-legales.component';
+import { RegisterComponent } from './components/register/register.component';
 import { CguComponent } from './components/shared/cgu/cgu.component';
-import { EmailingComponent } from './components/admin/emailing/emailing.component';
-import { StatisticComponent } from './components/admin/statistic/statistic.component';
-import { ProfilComponent } from './components/auth/profil/profil.component';
-import { GainComponent } from './components/auth/gain/gain.component';
-import { UsersComponent } from './components/admin/users/users.component';
+import { MentionsLegalesComponent } from './components/shared/mentions-legales/mentions-legales.component';
+import { PolitiqueConfidentialiteComponent } from './components/shared/politique-confidentialite/politique-confidentialite.component';
+import { ContactComponent } from './components/shared/contact/contact.component';
 import { NotFoundComponent } from './components/shared/not-found/not-found.component';
-import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-import { LoginComponent } from 'src/app/components/login/login.component';
-import { RegisterComponent } from 'src/app/components/register/register.component';
-//import { NavbarComponent } from 'src/app/components/shared/navbar/navbar.component';
-import { ContactComponent } from 'src/app/components/shared/contact/contact.component';
-import { HomeComponent } from './components/home/home.component';
-import { AuthGuard } from './guards/auth.guard';
 import { AdminLoginComponent } from './components/admin/admin-login/admin-login.component';
+import { UsersComponent } from './components/admin/users/users.component';
+import { StatisticComponent } from './components/admin/statistic/statistic.component';
+import { EmailingComponent } from './components/admin/emailing/emailing.component';
+import { AssistanceComponent } from './components/admin/assistance/assistance.component';
+import { GainComponent } from './components/auth/gain/gain.component';
 import { TirageComponent } from './components/auth/tirage/tirage.component';
+import { ProfilComponent } from './components/auth/profil/profil.component';
+import { AuthGuard } from './guards/auth.guard';
 
 const routes: Routes = [
-  { path: '', component: HomeComponent},
-  { path: 'login', component: LoginComponent },
-  { path: 'login/lost-password', component: LostPasswordComponent},
-  { path: 'login/reset-password/:token', component: ResetPasswordComponent},
-  { path: 'register', component: RegisterComponent},
-  { path: 'cgu', component: CguComponent},
-  { path: 'mention-legales', component: MentionsLegalesComponent},
-  { path: 'politique-de-confidentialite', component: PolitiqueConfidentialiteComponent},
-  { path: 'admin', component: AdminLoginComponent },
-
-  { path: 'users', component: UsersComponent },
-  { path: 'statistique', component: StatisticComponent, canActivate: [AuthGuard], data: {roles: ['admin'] }},
-  { path: 'emailing', component: EmailingComponent,  canActivate: [AuthGuard], data: {roles: ['admin'] }},
-  { path: 'assistance', component: AssistanceComponent, canActivate: [AuthGuard], data: {roles: ['admin'] }},
-  { path: 'contact', component: ContactComponent },
-  { path: 'home', component: HomeComponent },
-  { path: 'auth', component: GainComponent},
-  { path: 'tirage', component: TirageComponent},
-  { path: 'profil', component: ProfilComponent },
-  { path: '**', component: NotFoundComponent }
+  { 
+    path: '', 
+    component: HomeComponent,
+    data: {
+      title: 'Accueil - Fatboar : Grand Jeu-Concours Range Rover',
+      description: 'Participez au concours Fatboar pour gagner un Range Rover de 59 900€, des menus, burgers, desserts ou une réduction de 70%.',
+      keywords: 'fatboar, concours, range rover, burgers, menus, réductions, restauration',
+      ogTitle: 'Grand Jeu-Concours Fatboar',
+      ogDescription: 'Tentez votre chance pour gagner un Range Rover et d’autres prix sur Fatboar.',
+      ogImage: 'https://angular-preprod.foodgame.fr/assets/img/concours/range.png'
+    }
+  },
+  { 
+    path: 'home', 
+    component: HomeComponent,
+    data: {
+      title: 'Accueil - Fatboar : Grand Jeu-Concours Range Rover',
+      description: 'Participez au concours Fatboar pour gagner un Range Rover de 59 900€, des menus, burgers, desserts ou une réduction de 70%.',
+      keywords: 'fatboar, concours, range rover, burgers, menus, réductions, restauration',
+      ogTitle: 'Grand Jeu-Concours Fatboar',
+      ogDescription: 'Tentez votre chance pour gagner un Range Rover et d’autres prix sur Fatboar.',
+      ogImage: 'https://angular-preprod.foodgame.fr/assets/img/concours/range.png'
+    }
+  },
+  { 
+    path: 'login', 
+    component: LoginComponent,
+    data: {
+      title: 'Connexion - Fatboar',
+      description: 'Connectez-vous à votre compte Fatboar.',
+      keywords: 'fatboar, connexion, compte',
+      noIndex: true
+    }
+  },
+  { 
+    path: 'login/lost-password', 
+    component: LostPasswordComponent,
+    data: {
+      title: 'Mot de passe oublié - Fatboar',
+      description: 'Récupérez votre mot de passe pour votre compte Fatboar.',
+      keywords: 'fatboar, mot de passe oublié, récupération',
+      noIndex: true
+    }
+  },
+  { 
+    path: 'login/reset-password/:token', 
+    component: ResetPasswordComponent,
+    data: {
+      title: 'Réinitialiser le mot de passe - Fatboar',
+      description: 'Réinitialisez votre mot de passe Fatboar.',
+      keywords: 'fatboar, réinitialisation, mot de passe',
+      noIndex: true
+    }
+  },
+  { 
+    path: 'register', 
+    component: RegisterComponent,
+    data: {
+      title: 'Inscription - Fatboar',
+      description: 'Inscrivez-vous sur Fatboar pour participer à nos concours et profiter de nos services.',
+      keywords: 'fatboar, inscription, concours, restauration',
+      ogTitle: 'Inscription - Fatboar',
+      ogDescription: 'Rejoignez Fatboar pour participer à nos concours exclusifs.',
+      ogImage: 'https://angular-preprod.foodgame.fr/assets/fatboar-og.jpg'
+    }
+  },
+  { 
+    path: 'cgu', 
+    component: CguComponent,
+    data: {
+      title: 'Conditions Générales d’Utilisation - Fatboar',
+      description: 'Consultez les conditions générales d’utilisation de Fatboar.',
+      keywords: 'fatboar, cgu, conditions générales, restauration',
+      ogTitle: 'CGU - Fatboar',
+      ogDescription: 'Conditions générales d’utilisation de Fatboar.',
+      ogImage: 'https://angular-preprod.foodgame.fr/assets/fatboar-og.jpg'
+    }
+  },
+  { 
+    path: 'mention-legales', 
+    component: MentionsLegalesComponent,
+    data: {
+      title: 'Mentions Légales - Fatboar',
+      description: 'Consultez les mentions légales de Fatboar.',
+      keywords: 'fatboar, mentions légales, restauration',
+      ogTitle: 'Mentions Légales - Fatboar',
+      ogDescription: 'Mentions légales de Fatboar.',
+      ogImage: 'https://angular-preprod.foodgame.fr/assets/fatboar-og.jpg'
+    }
+  },
+  { 
+    path: 'politique-de-confidentialite', 
+    component: PolitiqueConfidentialiteComponent,
+    data: {
+      title: 'Politique de Confidentialité - Fatboar',
+      description: 'Découvrez la politique de confidentialité de Fatboar pour la protection de vos données.',
+      keywords: 'fatboar, politique de confidentialité, données personnelles',
+      ogTitle: 'Politique de Confidentialité - Fatboar',
+      ogDescription: 'Politique de confidentialité de Fatboar.',
+      ogImage: 'https://angular-preprod.foodgame.fr/assets/fatboar-og.jpg'
+    }
+  },
+  { 
+    path: 'contact', 
+    component: ContactComponent,
+    data: {
+      title: 'Contact - Fatboar',
+      description: 'Contactez l’équipe Fatboar pour toute question ou demande d’assistance.',
+      keywords: 'fatboar, contact, assistance, restauration',
+      ogTitle: 'Contact - Fatboar',
+      ogDescription: 'Contactez Fatboar pour toute question.',
+      ogImage: 'https://angular-preprod.foodgame.fr/assets/fatboar-og.jpg'
+    }
+  },
+  { 
+    path: 'tirage', 
+    component: TirageComponent,
+    data: {
+      title: 'Tirages - Fatboar',
+      description: 'Participez aux tirages Fatboar pour gagner des prix exclusifs.',
+      keywords: 'fatboar, tirages, concours, restauration',
+      ogTitle: 'Tirages - Fatboar',
+      ogDescription: 'Découvrez les tirages en cours sur Fatboar.',
+      ogImage: 'https://angular-preprod.foodgame.fr/assets/fatboar-og.jpg'
+    }
+  },
+  { 
+    path: 'admin', 
+    component: AdminLoginComponent,
+    data: {
+      title: 'Administration - Fatboar',
+      description: 'Panneau d’administration Fatboar.',
+      keywords: 'fatboar, admin',
+      noIndex: true
+    }
+  },
+  { 
+    path: 'users', 
+    component: UsersComponent,
+    data: {
+      title: 'Utilisateurs - Fatboar',
+      description: 'Gestion des utilisateurs Fatboar.',
+      keywords: 'fatboar, utilisateurs',
+      noIndex: true
+    }
+  },
+  { 
+    path: 'statistique', 
+    component: StatisticComponent,
+    canActivate: [AuthGuard],
+    data: {
+      roles: ['admin'],
+      title: 'Statistiques - Fatboar',
+      description: 'Statistiques du site Fatboar.',
+      keywords: 'fatboar, statistiques',
+      noIndex: true
+    }
+  },
+  { 
+    path: 'emailing', 
+    component: EmailingComponent,
+    canActivate: [AuthGuard],
+    data: {
+      roles: ['admin'],
+      title: 'Emailing - Fatboar',
+      description: 'Gestion des campagnes emailing Fatboar.',
+      keywords: 'fatboar, emailing',
+      noIndex: true
+    }
+  },
+  { 
+    path: 'assistance', 
+    component: AssistanceComponent,
+    canActivate: [AuthGuard],
+    data: {
+      roles: ['admin'],
+      title: 'Assistance - Fatboar',
+      description: 'Assistance pour les utilisateurs Fatboar.',
+      keywords: 'fatboar, assistance',
+      noIndex: true
+    }
+  },
+  { 
+    path: 'auth', 
+    component: GainComponent,
+    data: {
+      title: 'Gains - Fatboar',
+      description: 'Consultez vos gains sur Fatboar.',
+      keywords: 'fatboar, gains, concours',
+      noIndex: true
+    }
+  },
+  { 
+    path: 'profil', 
+    component: ProfilComponent,
+    data: {
+      title: 'Profil - Fatboar',
+      description: 'Gestion du profil utilisateur Fatboar.',
+      keywords: 'fatboar, profil',
+      noIndex: true
+    }
+  },
+  { 
+    path: '**', 
+    component: NotFoundComponent,
+    data: {
+      title: 'Page non trouvée - Fatboar',
+      description: 'Cette page n’existe pas sur Fatboar.',
+      keywords: 'fatboar, erreur 404',
+      noIndex: true
+    }
+  }
+  // Activer si /tirage/:id devient publique
+  // { 
+  //   path: 'tirage/:id', 
+  //   component: TirageComponent,
+  //   data: {
+  //     title: 'Tirage - Fatboar',
+  //     description: 'Participez à un tirage spécifique sur Fatboar.',
+  //     keywords: 'fatboar, tirage, concours, restauration',
+  //     ogTitle: 'Tirage - Fatboar',
+  //     ogDescription: 'Détails d’un tirage sur Fatboar.',
+  //     ogImage: 'https://angular-preprod.foodgame.fr/assets/fatboar-og.jpg'
+  //   }
+  // },
+  // Activer si /restaurants/:id existe
+  // { 
+  //   path: 'restaurants/:id', 
+  //   component: RestaurantComponent,
+  //   data: {
+  //     title: 'Restaurant - Fatboar',
+  //     description: 'Découvrez un restaurant Fatboar et ses offres.',
+  //     keywords: 'fatboar, restaurant, restauration',
+  //     ogTitle: 'Restaurant - Fatboar',
+  //     ogDescription: 'Détails d’un restaurant Fatboar.',
+  //     ogImage: 'https://angular-preprod.foodgame.fr/assets/fatboar-og.jpg'
+  //   }
+  // }
 ];
 
 @NgModule({
   imports: [RouterModule.forRoot(routes, {
     initialNavigation: 'enabled'
-})],
+  })],
   exports: [RouterModule]
 })
-export class AppRoutingModule { }
-
+export class AppRoutingModule { }

+ 28 - 3
angular-client/src/app/app.component.ts

@@ -1,10 +1,35 @@
-import { Component } from '@angular/core';
+import { Component, OnInit } from '@angular/core';
+import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
+import { SeoService } from './services/seo.service';
+import { filter, map, mergeMap } from 'rxjs/operators';
 
 @Component({
   selector: 'app-root',
   templateUrl: './app.component.html',
   styleUrls: ['./app.component.scss']
 })
-export class AppComponent {
+export class AppComponent implements OnInit {
   title = 'fatboar';
-}
+
+  constructor(
+    private router: Router,
+    private activatedRoute: ActivatedRoute,
+    private seoService: SeoService
+  ) {}
+
+  ngOnInit() {
+    this.router.events
+      .pipe(
+        filter(event => event instanceof NavigationEnd),
+        map(() => this.activatedRoute),
+        map(route => {
+          while (route.firstChild) route = route.firstChild;
+          return route;
+        }),
+        mergeMap(route => route.data)
+      )
+      .subscribe(data => {
+        this.seoService.updateMetaTags(data);
+      });
+  }
+}

+ 49 - 65
angular-client/src/app/components/home/home.component.html

@@ -1,71 +1,55 @@
 <div class="container navtop">
-        
-         <h1 class="text-center  gain mb-4">jeu-concours</h1>
-
-    <div class="range">
-        <h2 class="text-center  gain mb-4">Tentez de gagner un Range Rover </h2>
-        <h3 class="text-center concours font-weight-bold">Du 16 juillet 2020 au 16 septembre 2024</h3>
-        <h4 class="text-center concours">Pour tout achat d'une valeur de 18€ ou plus dans l'un de nos restaurants reçoit un code
-            Promo</h4>
-
-
-        <div class="row">
-            <div class="col-12 col-md-6 order-2 order-md-1">
-                <h4 class="col-12 col-md-9">A l'occasion de l'ouverture de notre 100e restaurants Fatboar, Tentez de repartir avec un Range Rover d'une valeur de 59900€ en participant à notre Grand jeu-concours FatBoar.</h4>
-                <h4 class="col-12 col-md-9">Il vous suffi d'une seule participation à notre jeu concours pour avoir une chance d'être tiré au sort et gagner votre Range Rover !</h4>
-                <h4 class="col-12 col-md-9">A noter que chacunes de vos participations vous offrons  une récompences !</h4>
-            </div>
-
-            <div class="col-12 col-md-6 order-1 order-md-2">
-                <img class="rangeRover"  [src]="getImgRange()" alt="Image of rangeRover" width="80%">
-            </div>
-
-        </div>
-
-        <div class=" row justify-content-center mt-3">
-            <button class="col-8 col-md-4 color-theme" mat-raised-button color="primary" type="submit" routerLink="/login">Je participe</button>
-        </div>
-
+  <h1 class="text-center gain mb-4">Jeu-concours Fatboar</h1>
+
+  <div class="range">
+    <h2 class="text-center gain mb-4">Tentez de gagner un Range Rover</h2>
+    <h3 class="text-center concours font-weight-bold">Du 16 juillet 2020 au 16 septembre 2024</h3>
+    <h4 class="text-center concours">Pour tout achat d'une valeur de 18€ ou plus dans l'un de nos restaurants, recevez un code promo</h4>
+
+    <div class="row">
+      <div class="col-12 col-md-6 order-2 order-md-1">
+        <h4 class="col-12 col-md-9">À l'occasion de l'ouverture de notre 100e restaurant Fatboar, tentez de repartir avec un Range Rover d'une valeur de 59 900€ en participant à notre grand jeu-concours.</h4>
+        <h4 class="col-12 col-md-9">Une seule participation suffit pour avoir une chance d'être tiré au sort et gagner votre Range Rover !</h4>
+        <h4 class="col-12 col-md-9">Chaque participation vous offre également une récompense garantie !</h4>
+      </div>
+
+      <div class="col-12 col-md-6 order-1 order-md-2">
+        <img class="rangeRover" [src]="getImgRange()" alt="Range Rover à gagner dans le concours Fatboar" width="80%">
+      </div>
     </div>
 
-    <div class="lots mt-4">
-       
-            <h2 class="text-center font-weight-bold">100% des tickets seront gagnants</h2>
-        
-
-        <div class="row mt-5">
-            <div class="col-4">
-                <img [src]="getDessert()" alt="A description of dessert au choix"  width="100%" >
-                <h2 class="text-center font-weight-bold dessert">Un dessert au choix</h2>
-               
-            </div>
-            <div class="col-4">
-               
-                <img [src]="getBurger()" alt="A description burger au choix"  width="90%">
-                <h2 class="text-center font-weight-bold">Un burger au choix</h2>
-            </div>
-            <div class="col-4">
-                
-                <img [src]="getMenuJour()" alt="A description of menu du jour"  width="60%">
-                <h2 class="text-center font-weight-bold">Un menu du jour</h2>
-            </div>
-        </div>
-
-        <div class="row justify-content-center">
-            <div class="col-4">
-                
-                <img [src]="getMenuChoix()" alt="A description of menu au choix"  width="90%">
-                <h2 class="text-center font-weight-bold">Un menu au choix</h2>
-            </div>
-            <div class="col-4">
-               
-                <img [src]="getReduction()" alt="A description of 70% de réduction"  width="90%">
-                <h2 class="text-center font-weight-bold">70% de réduction</h2>
-            </div>
-        </div>
-
-
-
+    <div class="row justify-content-center mt-3">
+      <button class="col-8 col-md-4 color-theme" mat-raised-button color="primary" type="submit" routerLink="/login">Je participe</button>
+    </div>
+  </div>
+
+  <div class="lots mt-4">
+    <h2 class="text-center font-weight-bold">100% des tickets sont gagnants</h2>
+
+    <div class="row mt-5">
+      <div class="col-4">
+        <img [src]="getDessert()" alt="Dessert au choix offert dans le concours Fatboar" width="100%">
+        <h2 class="text-center font-weight-bold dessert">Un dessert au choix</h2>
+      </div>
+      <div class="col-4">
+        <img [src]="getBurger()" alt="Burger au choix offert dans le concours Fatboar" width="90%">
+        <h2 class="text-center font-weight-bold">Un burger au choix</h2>
+      </div>
+      <div class="col-4">
+        <img [src]="getMenuJour()" alt="Menu du jour offert dans le concours Fatboar" width="60%">
+        <h2 class="text-center font-weight-bold">Un menu du jour</h2>
+      </div>
     </div>
 
+    <div class="row justify-content-center">
+      <div class="col-4">
+        <img [src]="getMenuChoix()" alt="Menu au choix offert dans le concours Fatboar" width="90%">
+        <h2 class="text-center font-weight-bold">Un menu au choix</h2>
+      </div>
+      <div class="col-4">
+        <img [src]="getReduction()" alt="Réduction de 70% dans le concours Fatboar" width="90%">
+        <h2 class="text-center font-weight-bold">70% de réduction</h2>
+      </div>
+    </div>
+  </div>
 </div>

+ 60 - 23
angular-client/src/app/components/home/home.component.ts

@@ -1,11 +1,12 @@
 import { Component, OnInit } from '@angular/core';
-import { DomSanitizer } from "@angular/platform-browser";
-const imgRange = "assets/img/concours/range.png";
-const imgReduction = "assets/img/concours/70.png";
-const imgBurger = "assets/img/concours/burger2.png";
-const imgDessert = "assets/img/concours/dessert5.png";
-const imgMenuJour = "assets/img/concours/menu-jour.png";
-const imgMenuChoix = "assets/img/concours/menu-choix.png";
+import { DomSanitizer } from '@angular/platform-browser';
+
+const imgRange = 'assets/img/concours/range.png';
+const imgReduction = 'assets/img/concours/70.png';
+const imgBurger = 'assets/img/concours/burger2.png';
+const imgDessert = 'assets/img/concours/dessert5.png';
+const imgMenuJour = 'assets/img/concours/menu-jour.png';
+const imgMenuChoix = 'assets/img/concours/menu-choix.png';
 
 @Component({
   selector: 'app-home',
@@ -13,34 +14,70 @@ const imgMenuChoix = "assets/img/concours/menu-choix.png";
   styleUrls: ['./home.component.scss']
 })
 export class HomeComponent implements OnInit {
+  jsonLd = {
+    '@context': 'https://schema.org',
+    '@type': 'Event',
+    name: 'Grand Jeu-Concours Fatboar',
+    description: 'Participez au concours Fatboar pour gagner un Range Rover d’une valeur de 59 900€, des menus, burgers, desserts ou une réduction de 70%.',
+    startDate: '2020-07-16',
+    endDate: '2024-09-16',
+    eventAttendanceMode: 'https://schema.org/OfflineEventAttendanceMode',
+    eventStatus: 'https://schema.org/EventScheduled',
+    location: {
+      '@type': 'Place',
+      name: 'Restaurants Fatboar',
+      address: {
+        '@type': 'PostalAddress',
+        addressCountry: 'FR'
+      }
+    },
+    image: 'https://angular-preprod.foodgame.fr/assets/img/concours/range.png',
+    offers: {
+      '@type': 'Offer',
+      name: 'Participation au concours',
+      price: '18',
+      priceCurrency: 'EUR',
+      availability: 'https://schema.org/InStock',
+      validFrom: '2020-07-16',
+      url: 'https://angular-preprod.foodgame.fr'
+    },
+    organizer: {
+      '@type': 'Organization',
+      name: 'Fatboar',
+      url: 'https://angular-preprod.foodgame.fr'
+    }
+  };
 
-  constructor( private domSanitizer: DomSanitizer, ) { }
+  constructor(private domSanitizer: DomSanitizer) {}
 
   ngOnInit(): void {
-  }
-  
-  getImgRange(){
-    return this.domSanitizer.bypassSecurityTrustResourceUrl(imgRange)
+    const script = document.createElement('script');
+    script.type = 'application/ld+json';
+    script.text = JSON.stringify(this.jsonLd);
+    document.head.appendChild(script);
   }
 
-  getDessert(){
-    return this.domSanitizer.bypassSecurityTrustResourceUrl(imgDessert)
+  getImgRange() {
+    return this.domSanitizer.bypassSecurityTrustResourceUrl(imgRange);
   }
 
-  getBurger(){
-    return this.domSanitizer.bypassSecurityTrustResourceUrl(imgBurger)
+  getDessert() {
+    return this.domSanitizer.bypassSecurityTrustResourceUrl(imgDessert);
   }
 
-  getMenuJour(){
-    return this.domSanitizer.bypassSecurityTrustResourceUrl(imgMenuJour)
+  getBurger() {
+    return this.domSanitizer.bypassSecurityTrustResourceUrl(imgBurger);
   }
 
-  getMenuChoix(){
-    return this.domSanitizer.bypassSecurityTrustResourceUrl(imgMenuChoix)
+  getMenuJour() {
+    return this.domSanitizer.bypassSecurityTrustResourceUrl(imgMenuJour);
   }
 
-  getReduction(){
-    return this.domSanitizer.bypassSecurityTrustResourceUrl(imgReduction)
+  getMenuChoix() {
+    return this.domSanitizer.bypassSecurityTrustResourceUrl(imgMenuChoix);
   }
 
-}
+  getReduction() {
+    return this.domSanitizer.bypassSecurityTrustResourceUrl(imgReduction);
+  }
+}

+ 35 - 0
angular-client/src/app/services/seo.service.ts

@@ -0,0 +1,35 @@
+import { Injectable } from '@angular/core';
+import { Meta, Title } from '@angular/platform-browser';
+
+@Injectable({
+  providedIn: 'root'
+})
+export class SeoService {
+  constructor(private title: Title, private meta: Meta) {}
+
+  updateMetaTags(data: any) {
+    if (data.title) {
+      this.title.setTitle(data.title);
+    }
+    if (data.description) {
+      this.meta.updateTag({ name: 'description', content: data.description });
+    }
+    if (data.keywords) {
+      this.meta.updateTag({ name: 'keywords', content: data.keywords });
+    }
+    if (data.ogTitle) {
+      this.meta.updateTag({ property: 'og:title', content: data.ogTitle });
+    }
+    if (data.ogDescription) {
+      this.meta.updateTag({ property: 'og:description', content: data.ogDescription });
+    }
+    if (data.ogImage) {
+      this.meta.updateTag({ property: 'og:image', content: data.ogImage });
+    }
+    if (data.noIndex) {
+      this.meta.updateTag({ name: 'robots', content: 'noindex, nofollow' });
+    } else {
+      this.meta.removeTag("name='robots'");
+    }
+  }
+}

+ 15 - 2
angular-client/src/index.html

@@ -1,10 +1,23 @@
 <!doctype html>
-<html lang="en">
+<html lang="fr">
 <head>
   <meta charset="utf-8">
   <title>Fatboar</title>
   <base href="/">
   <meta name="viewport" content="width=device-width, initial-scale=1">
+  <meta name="description" content="Fatboar - Participez à des concours exclusifs pour gagner un Range Rover, des menus, burgers, desserts et réductions.">
+  <meta name="keywords" content="fatboar, concours, range rover, burgers, menus, réductions, restauration">
+  <meta name="robots" content="index, follow">
+  <meta property="og:title" content="Fatboar - Jeu-Concours">
+  <meta property="og:description" content="Tentez votre chance pour gagner un Range Rover et d’autres prix avec Fatboar.">
+  <meta property="og:image" content="https://angular-preprod.foodgame.fr/assets/fatboar-og.jpg">
+  <meta property="og:url" content="https://angular-preprod.foodgame.fr">
+  <meta property="og:type" content="website">
+  <meta name="twitter:card" content="summary_large_image">
+  <meta name="twitter:title" content="Fatboar - Jeu-Concours">
+  <meta name="twitter:description" content="Tentez votre chance pour gagner un Range Rover et d’autres prix avec Fatboar.">
+  <meta name="twitter:image" content="https://angular-preprod.foodgame.fr/assets/fatboar-og.jpg">
+  <link rel="canonical" href="https://angular-preprod.foodgame.fr">
   <link rel="icon" type="image/x-icon" href="favicon.ico">
   <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" rel="stylesheet">
   <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
@@ -12,4 +25,4 @@
 <body class="mat-typography">
   <app-root></app-root>
 </body>
-</html>
+</html>

+ 10 - 4
angular-client/src/robots.txt

@@ -1,6 +1,12 @@
 User-agent: *
-Disallow: /admin/
-Disallow: /login/
 Allow: /
-
-Sitemap: https://angular-preprod.foodgame.fr/sitemap.xml
+Disallow: /login
+Disallow: /login/lost-password
+Disallow: /login/reset-password
+Disallow: /users
+Disallow: /statistique
+Disallow: /emailing
+Disallow: /assistance
+Disallow: /auth
+Disallow: /profil
+Sitemap: https://angular-preprod.foodgame.fr/sitemap.xml

+ 76 - 89
express-server/index.js

@@ -1,5 +1,6 @@
 const express = require('express');
-const bodyparser = require('body-parser');
+const compression = require('compression');
+const bodyParser = require('body-parser');
 const passport = require('passport');
 const mongoose = require('mongoose');
 const session = require('express-session');
@@ -7,13 +8,10 @@ const cors = require('cors');
 const { TextEncoder, TextDecoder } = require('util');
 global.TextEncoder = TextEncoder;
 global.TextDecoder = TextDecoder;
-// const config = require('./config/db.config');
-
 
 const userRoutes = require('./routes/user');
 const employeeRoutes = require('./routes/employee');
 const authRoutes = require('./routes/auth');
-//const oauthRoutes = require('./routes/oauth');
 const ticketRoutes = require('./routes/ticket');
 const emailsRoutes = require('./routes/emailing');
 const authGoogle = require('./routes/google');
@@ -22,108 +20,97 @@ const tirageRoutes = require('./routes/tirage');
 const contactRoutes = require('./routes/contact');
 const restaurantRoutes = require('./routes/restaurant');
 
-const Logger = require('./logging')
-
-//metrics
-const makeApiMiddleware = require("api-express-exporter"); 
-//const apiMetrics = require('prometheus-api-metrics');
-const promBundle = require("express-prom-bundle");
-const metricsMiddleware = promBundle({includeMethod: true, includePath: true});
+const Logger = require('./logging');
+const makeApiMiddleware = require('api-express-exporter');
+const promBundle = require('express-prom-bundle');
+const metricsMiddleware = promBundle({ includeMethod: true, includePath: true });
 
+const { app: ssrApp } = require('../dist/fatboar/server/main');
 
 const app = express();
 
-// Configure CORS
+app.use(compression());
+
 app.use(cors({
-  origin: 'https://angular-preprod.foodgame.fr', // Remplacez par l'URL de votre frontend Angular
-  optionsSuccessStatus: 200 // Facultatif : indique le statut de succès pour les pré-vérifications OPTIONS
+  origin: 'https://angular-preprod.foodgame.fr',
+  optionsSuccessStatus: 200
 }));
 
-
-
-
-
-Logger.error('hello world', 'Nan c est juste pour tester les logs')
-
 app.use(metricsMiddleware);
-//app.use(apiMetrics()); 
-
-
-//metrics
-app.use(makeApiMiddleware()); 
-//app.use(cors());
+app.use(makeApiMiddleware());
+
+app.use(bodyParser.json());
+app.use(bodyParser.urlencoded({ extended: true }));
+app.use(express.urlencoded({ extended: true }));
+app.use(session({
+  secret: 'this_is_a_secret',
+  resave: true,
+  saveUninitialized: true,
+  rolling: true,
+  cookie: {
+    maxAge: 360000,
+    secure: false
+  }
+}));
+app.use(passport.initialize());
 
-app.get("/api", (req, res) => {
-    res.status(200).send("Api Works.");
+app.use(express.static('dist/fatboar/browser'));
+
+app.get('/sitemap.xml', async (req, res) => {
+  res.header('Content-Type', 'application/xml');
+  const baseUrl = 'https://angular-preprod.foodgame.fr';
+  let xml = `<?xml version="1.0" encoding="UTF-8"?>
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">`;
+
+  const staticPages = [
+    { url: '/', lastmod: '2025-06-24', changefreq: 'daily', priority: '1.0' },
+    { url: '/home', lastmod: '2025-06-24', changefreq: 'daily', priority: '0.9' },
+    { url: '/register', lastmod: '2025-06-24', changefreq: 'weekly', priority: '0.8' },
+    { url: '/cgu', lastmod: '2025-06-24', changefreq: 'monthly', priority: '0.7' },
+    { url: '/mention-legales', lastmod: '2025-06-24', changefreq: 'monthly', priority: '0.7' },
+    { url: '/politique-de-confidentialite', lastmod: '2025-06-24', changefreq: 'monthly', priority: '0.7' },
+    { url: '/contact', lastmod: '2025-06-24', changefreq: 'weekly', priority: '0.8' },
+    { url: '/tirage', lastmod: '2025-06-24', changefreq: 'daily', priority: '0.9' }
+  ];
+
+  staticPages.forEach(page => {
+    xml += `
+  <url>
+    <loc>${baseUrl}${page.url}</loc>
+    <lastmod>${page.lastmod}</lastmod>
+    <changefreq>${page.changefreq}</changefreq>
+    <priority>${page.priority}</priority>
+  </url>`;
   });
 
-  
-//Définition des CORS Middleware 
-// app.use(function(req, res, next) {
-  
-//     //res.header("Access-Control-Allow-Origin", "*");
-//     res.setHeader("Access-Control-Allow-Origin", "*");
-//     res.setHeader(
-//       "Access-Control-Allow-Headers",
-//       "X-Requested-With,content-type, Accept,Authorization,Origin"
-//     );
-//     res.setHeader(
-//       "Access-Control-Allow-Methods",
-//       "GET, POST, OPTIONS, PUT, PATCH, DELETE"
-//     );
-//     res.setHeader("Access-Control-Allow-Credentials", true);
-//     next();
-//   });
-// Middleware pour définir le type de contenu des réponses
-app.use((req, res, next) => {
-  res.setHeader('Content-Type', 'application/json');
-  next();
+  xml += `
+</urlset>`;
+  res.send(xml);
 });
 
+app.get('/robots.txt', (req, res) => {
+  res.sendFile('robots.txt', { root: 'dist/fatboar/browser' });
+});
 
+app.get('/api', (req, res) => {
+  res.status(200).send('Api Works.');
+});
+app.use('/api/users', userRoutes);
+app.use('/api/employees', employeeRoutes);
+app.use('/api/tickets', ticketRoutes);
+app.use('/api/auth', authRoutes);
+app.use('/api/emails', emailsRoutes);
+app.use('/api/auth/google', authGoogle);
+app.use('/api/auth/facebook', authFacebook);
+app.use('/api/tirage', tirageRoutes);
+app.use('/api/contact', contactRoutes);
+app.use('/api/restaurants', restaurantRoutes);
+
+app.use(ssrApp());
 
-// parse requests  body params
-app.use(bodyparser.json());
-app.use(bodyparser.urlencoded({extended: true}));
-//app.use(cookiePrser());
-app.use(express.urlencoded({ extended: true}));
-app.use(
-  session({
-    secret: "this_is_a_secret",
-    resave: true,
-    saveUnitialized: true,
-    rolling: true, // forces resetting of max age
-    cookie: {
-      maxAge: 360000,
-      secure: false // this should be true only when you don't want to show it for security reason
-    }
-  })
-);
-app.use(passport.initialize());
-//app.use(passport.session());
-
-//simple route
-app.use('/api/users', userRoutes );
-app.use('/api/employees', employeeRoutes );
-app.use('/api/tickets', ticketRoutes );
-app.use('/api/auth',  authRoutes );
-//app.use('/api/auth', oauthRoutes );
-//app.use('/api/auth',  authGoogle );
-app.use('/api/emails',  emailsRoutes );
-app.use('/api/auth/google',  authGoogle );
-app.use('/api/auth/facebook',  authFacebook );
-app.use('/api/tirage',  tirageRoutes );
-app.use('/api/contact',  contactRoutes );
-app.use('/api/restaurants',  restaurantRoutes );
-
-//connexion database
 require('./lib/db');
 
-
-
-
-//listen for requests 
 const PORT = process.env.PORT || 4000;
 app.listen(PORT, () => {
-    console.log(`Api listen on port ${PORT}.`);
+  console.log(`Api listen on port ${PORT}.`);
 });