Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusLukasukas committed Oct 28, 2023
1 parent 8f588da commit 0a12d65
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion actions/getAirPollutionData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const getAirPollutionData = async ({
lon: string
}) => {
const data = await fetch(
`http://localhost:3000/api/weather/air_pollution?lat=${lat}&lon=${lon}&appid=${process.env.NEXT_PUBLIC_OPEN_WEATHER_API_KEY}`,
`${process.env.DOMAIN}/api/weather/air_pollution?lat=${lat}&lon=${lon}&appid=${process.env.OPEN_WEATHER_API_KEY}`,
{
next: { revalidate: 900 },
}
Expand Down
2 changes: 1 addition & 1 deletion actions/getHourlyData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const getHourlyData = async ({
lon: string
}) => {
const data = await fetch(
`http://localhost:3000/api/weather/hourly?lat=${lat}&lon=${lon}&appid=${process.env.NEXT_PUBLIC_OPEN_WEATHER_API_KEY}`,
`${process.env.DOMAIN}/api/weather/hourly?lat=${lat}&lon=${lon}&appid=${process.env.OPEN_WEATHER_API_KEY}`,
{
next: { revalidate: 900 },
}
Expand Down
2 changes: 1 addition & 1 deletion actions/getTenDayForecast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const getTenDayForecast = async ({
lon: string
}) => {
const data = await fetch(
`http://localhost:3000/api/weather/daily_forecast?lat=${lat}&lon=${lon}&appid=${process.env.NEXT_PUBLIC_OPEN_WEATHER_API_KEY}`,
`${process.env.DOMAIN}/api/weather/daily_forecast?lat=${lat}&lon=${lon}&appid=${process.env.OPEN_WEATHER_API_KEY}`,
{
next: { revalidate: 900 },
}
Expand Down
2 changes: 1 addition & 1 deletion actions/getUVData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const getUVData = async ({ lat, lon }: { lat: string; lon: string }) => {
const data = await fetch(
`http://localhost:3000/api/weather/uv_index?lat=${lat}&lon=${lon}`,
`${process.env.DOMAIN}/api/weather/uv_index?lat=${lat}&lon=${lon}`,
{
next: { revalidate: 900 },
}
Expand Down
2 changes: 1 addition & 1 deletion app/api/weather/air_pollution/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function GET(request: Request) {
}

const res = await fetch(
`http://api.openweathermap.org/data/2.5/air_pollution?lat=${lat}&lon=${lon}&units=metric&appid=${appid}`,
`https://api.openweathermap.org/data/2.5/air_pollution?lat=${lat}&lon=${lon}&units=metric&appid=${appid}`,
{
next: { revalidate: 900 },
}
Expand Down
2 changes: 1 addition & 1 deletion app/api/weather/hourly/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function GET(request: Request) {
}

const res = await fetch(
`https://pro.openweathermap.org/data/2.5/forecast/hourly?lat=${lat}&lon=${lon}&cnt=${HOURS}&units=metric&appid=${appid}`,
`http://pro.openweathermap.org/data/2.5/forecast/hourly?lat=${lat}&lon=${lon}&cnt=${HOURS}&units=metric&appid=${appid}`,
{
next: { revalidate: 900 },
}
Expand Down
2 changes: 1 addition & 1 deletion app/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function generateMetadata({
}): Promise<Metadata> {
const { lat, lon } = searchParams

const url = `http://localhost:3000/api/weather/hourly?lat=${lat}&lon=${lon}&appid=${process.env.NEXT_PUBLIC_OPEN_WEATHER_API_KEY}`
const url = `/api/weather/hourly?lat=${lat}&lon=${lon}&appid=${process.env.NEXT_PUBLIC_OPEN_WEATHER_API_KEY}`

const data = await fetch(url).then((res) => res.json())

Expand Down
6 changes: 1 addition & 5 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
typedRoutes: true,
},
}
const nextConfig = {}

module.exports = nextConfig

0 comments on commit 0a12d65

Please sign in to comment.