-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
335 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
experimental: { | ||
appDir: true, | ||
serverActions: true | ||
}, | ||
generateEtags: true, | ||
swcMinify: true, | ||
poweredByHeader: false, | ||
output: 'standalone', | ||
images: { | ||
domains: ['radio.hellnet.eu'] | ||
} | ||
} | ||
generateEtags: true, | ||
swcMinify: true, | ||
poweredByHeader: false, | ||
output: "standalone", | ||
images: { | ||
remotePatterns: [{ | ||
protocol: 'https', | ||
hostname: 'radio.hellnet.eu' | ||
}], | ||
}, | ||
}; | ||
|
||
module.exports = nextConfig | ||
module.exports = nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import axios from "@/http/axios.http"; | ||
import moment from "moment"; | ||
|
||
const CONST_API_KEY = process.env.GIPHY_API_KEY; | ||
const CONST_GIPHY_RATING = process.env.GIPHY_RATING; | ||
const CONST_TAG = moment().day() === 5 ? process.env.GIPHY_TAG_IS_FRIDAY : process.env.GIPHY_TAG_IS_NOT_FRIDAY; | ||
|
||
export async function GET(request: Request) { | ||
const { searchParams } = new URL(request.url); | ||
const id = searchParams.get("id") || "random"; | ||
|
||
try { | ||
const response = await axios({ | ||
method: "GET", | ||
baseURL: "https://api.giphy.com", | ||
url: `/v1/gifs/${id}`, | ||
params: { api_key: CONST_API_KEY, rating: CONST_GIPHY_RATING, tag: CONST_TAG }, | ||
}); | ||
|
||
return Response.json(response); | ||
} catch (e) { | ||
return Response.json( | ||
{}, | ||
{ | ||
status: 500, | ||
statusText: "Internal error", | ||
} | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"use client"; | ||
|
||
import { type ReactNode } from "react"; | ||
|
||
import NavbarComponent from "@/components/ui/navbar/navbar.component"; | ||
import StandWithUkraineComponent from "@/components/ui/stand-with-ukraine/stand-with-ukraine.component"; | ||
|
||
interface IProps { | ||
children: ReactNode; | ||
} | ||
|
||
export default function MainLayout({ children }: IProps) { | ||
return ( | ||
<> | ||
<NavbarComponent /> | ||
<StandWithUkraineComponent /> | ||
<main className="px-6 mx-auto max-w-screen-md pt-24">{children}</main> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import axios, {type CreateAxiosDefaults, type AxiosInstance} from "axios"; | ||
|
||
export default (config: CreateAxiosDefaults): AxiosInstance => axios.create(config); |
Oops, something went wrong.