mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-12-22 18:00:17 +00:00
chore: use env var for api url
This commit is contained in:
parent
d86cf81719
commit
42ff29c13d
@ -1,5 +1,8 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
images: {
|
||||
domains: ["localhost", "tube.stiforr.tech"],
|
||||
},
|
||||
experimental: {
|
||||
runtime: "nodejs",
|
||||
},
|
||||
|
@ -43,7 +43,7 @@ export const VideoList = ({ videos }: { videos: Videos }) => {
|
||||
light="false"
|
||||
playing // TODO: Not currently working
|
||||
playsinline
|
||||
url={`http://localhost:8000/media/${selectedVideoUrl.media_url}`}
|
||||
url={`${process.env.NEXT_PUBLIC_TUBEARCHIVIST_URL}/media/${selectedVideoUrl.media_url}`}
|
||||
/>
|
||||
<div className="player-title boxed-content">
|
||||
<NextImage
|
||||
@ -171,7 +171,7 @@ export const VideoList = ({ videos }: { videos: Videos }) => {
|
||||
<div className="video-thumb-wrap list">
|
||||
<div className="video-thumb">
|
||||
<NextImage
|
||||
src={`http://localhost:8000/cache/${video.vid_thumb_url}`}
|
||||
src={`${process.env.NEXT_PUBLIC_TUBEARCHIVIST_URL}/cache/${video.vid_thumb_url}`}
|
||||
alt="video-thumb"
|
||||
width={250}
|
||||
height={141}
|
||||
|
@ -34,14 +34,17 @@ const Home: NextPage<{ videos: Videos }> = ({ videos }) => {
|
||||
export default Home;
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
const response = await fetch("http://localhost:8000/api/video/", {
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Token b4d4330462c7fc16c51873e45579b29a1a12fc90`,
|
||||
mode: "no-cors",
|
||||
},
|
||||
});
|
||||
const response = await fetch(
|
||||
`${process.env.NEXT_PUBLIC_TUBEARCHIVIST_URL}/api/video/`,
|
||||
{
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Token b4d4330462c7fc16c51873e45579b29a1a12fc90`,
|
||||
mode: "no-cors",
|
||||
},
|
||||
}
|
||||
);
|
||||
const videos = await response.json();
|
||||
|
||||
return { props: { videos } };
|
||||
|
Loading…
Reference in New Issue
Block a user