No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

31 líneas
861 B

  1. import type { NextConfig } from "next";
  2. import { BASE_PATH } from "./lib/config";
  3. const nextConfig: NextConfig = {
  4. basePath: BASE_PATH || undefined,
  5. allowedDevOrigins: ['10.210.1.225'],
  6. serverExternalPackages: ['sanitize-html', 'file-type'],
  7. // Quando l'app vive sotto un sotto-percorso, le rotte "nude" rispondevano 404:
  8. // chi atterra su http://host:3000/ o /admin viene rediretto sotto il basePath.
  9. // basePath: false evita che Next prefissi automaticamente source/destination.
  10. async redirects() {
  11. if (!BASE_PATH) return [];
  12. return [
  13. {
  14. source: '/',
  15. destination: BASE_PATH,
  16. basePath: false,
  17. permanent: false,
  18. },
  19. {
  20. source: '/admin',
  21. destination: `${BASE_PATH}/admin`,
  22. basePath: false,
  23. permanent: false,
  24. },
  25. ];
  26. },
  27. };
  28. export default nextConfig;