This commit is contained in:
Owen Rees
2023-06-13 09:47:58 +02:00
parent 678fef42c0
commit d8a70d5a63
3 changed files with 6 additions and 6 deletions
+1
View File
@@ -0,0 +1 @@
NEXT_PUBLIC_HOSTNAME = "https://echecsfrance.vercel.app"
+1 -5
View File
@@ -1,8 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
env: {
SERVER: process.env.SERVER,
},
};
const nextConfig = {};
module.exports = nextConfig;
+4 -1
View File
@@ -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 },