SPB Git

Repository Public

next.config.ts 2.9 KB 81 lines typescript

1/**2 * =============================================================================3 *                  SP BOUCHER | SOFTWARE & RESEARCH4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project          : Vrai-Prix8 * File             : next.config.ts9 * Repository       : https://git.spboucher.ai/vrai-prix10 * Created          : 2026-08-0811 * Last Modified    : 2026-08-1312 *13 * Author           : Simon-Pierre Boucher14 * Position         : Professor of Finance15 * Institution      : Université du Québec en Outaouais (UQO)16 * Organization     : SP Boucher17 * Website          : https://spboucher.ai18 * Git              : https://git.spboucher.ai19 *20 * Preferred Contact: contact@spboucher.ai21 * Development      : dev@spboucher.ai22 * Support          : support@spboucher.ai23 * Security/Admin   : admin@spboucher.ai24 *25 * Copyright (c) 202626 * Simon-Pierre Boucher27 * All rights reserved where applicable. This file is governed by the28 * applicable project license, copyright notices and relevant law.29 * Existing third-party rights and notices remain unaffected.30 *31 * License          : None specified (no license file in this repository)32 *33 * Do not embed credentials, private keys, access tokens,34 * certificates or confidential personal information.35 *36 * =============================================================================37 * END OF SP BOUCHER SOURCE HEADER38 * =============================================================================39 */4041import type { NextConfig } from "next";4243// Préproduction (VP_PREPROD=1 dans .env.local) : rien n'est indexé.44const PREPROD = process.env.VP_PREPROD === "1";4546const nextConfig: NextConfig = {47  serverExternalPackages: ["better-sqlite3", "pdfkit"],48  async redirects() {49    // anciennes adresses publiques de la v1 sans équivalent direct50    return [51      { source: "/doc", destination: "/methodologie", permanent: true },52      { source: "/doc/:path*", destination: "/methodologie", permanent: true },53    ];54  },55  async headers() {56    const regles = [57      {58        // API : lecture ouverte à toute origine (app iOS, intégrations). Aucun59        // témoin ni authentification : rien de privé n'est exposé par ce CORS.60        source: "/api/:path*",61        headers: [62          { key: "Access-Control-Allow-Origin", value: "*" },63          { key: "Access-Control-Allow-Methods", value: "GET, HEAD, OPTIONS" },64          { key: "Access-Control-Allow-Headers", value: "Content-Type, Accept" },65          { key: "Access-Control-Max-Age", value: "86400" },66          { key: "X-Robots-Tag", value: "noindex" },67        ],68      },69    ];70    if (PREPROD) {71      regles.push({72        source: "/:path*",73        headers: [{ key: "X-Robots-Tag", value: "noindex, nofollow" }],74      });75    }76    return regles;77  },78};7980export default nextConfig;81
Files main
Menu

Theme