Skip to content

Commit ad83ea9

Browse files
authored
feat: proxy tv maze api (#1863)
1 parent 05ae395 commit ad83ea9

File tree

21 files changed

+284
-278
lines changed

21 files changed

+284
-278
lines changed

demos/default/pages/api/shows/[...params].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default async (req, res) => {
1010
const id = params[0]
1111

1212
// Get the data
13-
const fetchRes = await fetch(`https://api.tvmaze.com/shows/${id}`)
13+
const fetchRes = await fetch(`https://tvproxy.netlify.app/shows/${id}`)
1414
const data = await fetchRes.json()
1515

1616
// If show was found, return it

demos/default/pages/api/shows/[id].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default async (req, res) => {
77
const { id } = query
88

99
// Get the data
10-
const fetchRes = await fetch(`https://api.tvmaze.com/shows/${id}`)
10+
const fetchRes = await fetch(`https://tvproxy.netlify.app/shows/${id}`)
1111
const data = await fetchRes.json()
1212

1313
// If show was found, return it

demos/default/pages/deep/import.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const Show = ({ show }) => (
2525
)
2626

2727
export const getServerSideProps = async ({ params }) => {
28-
const res = await fetch('https://api.tvmaze.com/shows/42')
28+
const res = await fetch('https://tvproxy.netlify.app/shows/42')
2929
const data = await res.json()
3030

3131
return {

demos/default/pages/getServerSideProps/[id].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const getServerSideProps = async ({ params }) => {
3434
// The ID to render
3535
const { id } = params
3636

37-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
37+
const res = await fetch(`https://tvproxy.netlify.app/shows/${id}`)
3838
const data = await res.json()
3939

4040
// Set error code if show item could not be found

demos/default/pages/getServerSideProps/all/[[...slug]].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const getServerSideProps = async ({ params }) => {
3434
// The ID to render
3535
const { slug } = params
3636

37-
const res = await fetch(`https://api.tvmaze.com/shows/${slug[0]}`)
37+
const res = await fetch(`https://tvproxy.netlify.app/shows/${slug[0]}`)
3838
const data = await res.json()
3939

4040
// Set error code if show item could not be found

demos/default/pages/getServerSideProps/static.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const Show = ({ show }) => (
2222
)
2323

2424
export const getServerSideProps = async ({ params }) => {
25-
const res = await fetch('https://api.tvmaze.com/shows/42')
25+
const res = await fetch('https://tvproxy.netlify.app/shows/42')
2626
const data = await res.json()
2727

2828
return {

demos/default/pages/getStaticProps/[id].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function getStaticProps({ params }) {
2828
// The ID to render
2929
const { id } = params
3030

31-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
31+
const res = await fetch(`https://tvproxy.netlify.app/shows/${id}`)
3232
const data = await res.json()
3333
const time = new Date().toLocaleTimeString()
3434

demos/default/pages/getStaticProps/static.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Show = ({ show }) => (
1616
)
1717

1818
export async function getStaticProps(context) {
19-
const res = await fetch(`https://api.tvmaze.com/shows/71`)
19+
const res = await fetch(`https://tvproxy.netlify.app/shows/71`)
2020
const data = await res.json()
2121

2222
return {

demos/default/pages/getStaticProps/with-revalidate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Show = ({ show }) => (
1616
)
1717

1818
export async function getStaticProps(context) {
19-
const res = await fetch(`https://api.tvmaze.com/shows/71`)
19+
const res = await fetch(`https://tvproxy.netlify.app/shows/71`)
2020
const data = await res.json()
2121

2222
return {

demos/default/pages/getStaticProps/withFallback/[...slug].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function getStaticProps({ params }) {
4242
const { slug } = params
4343
const id = slug[slug.length - 1]
4444

45-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
45+
const res = await fetch(`https://tvproxy.netlify.app/shows/${id}`)
4646
const data = await res.json()
4747
const time = new Date().toLocaleTimeString()
4848

0 commit comments

Comments
 (0)