mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 04:26:57 +00:00
env
This commit is contained in:
+1
-5
@@ -1,8 +1,4 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
env: {
|
||||
SERVER: process.env.SERVER,
|
||||
},
|
||||
};
|
||||
const nextConfig = {};
|
||||
|
||||
module.exports = nextConfig;
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
* @remarks The result is cached for the revalidation period in seconds
|
||||
*/
|
||||
export default async function getTournaments(country: string) {
|
||||
const server = process.env.SERVER;
|
||||
const server =
|
||||
process.env.NODE_ENV === "production"
|
||||
? process.env.NEXT_PUBLIC_HOSTNAME
|
||||
: "http://localhost:3000";
|
||||
|
||||
const res = await fetch(`${server}/api/tournaments/${country}`, {
|
||||
next: { revalidate: 300 },
|
||||
|
||||
Reference in New Issue
Block a user