Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env big fix #48

Merged
merged 1 commit into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions frontend-nextjs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,3 @@ const nextConfig = {
};

module.exports = nextConfig;

module.exports = {
env: {
SERVER_URL: "http://localhost:3001",
},
};
2 changes: 1 addition & 1 deletion frontend-nextjs/pages/components/PortfolioGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function PortfolioGrid() {
const [events, setEvents] = useState([]);
useEffect(() => {
const fetchEvent = async () => {
const response = await axios.get(`${process.env.SERVER_URL}/api/event`);
const response = await axios.get(`${process.env.NEXT_PUBLIC_SERVER_URL}/api/event`);
setEvents(response.data);
};
fetchEvent();
Expand Down
3 changes: 1 addition & 2 deletions frontend-nextjs/pages/event/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ const CreateEvent = () => {
const [category, setCategory] = useState("");
const [imgUrl, setImgUrl] = useState("");
const [youtubeLink, setYoutubeLink] = useState("");
console.log("env",`${process.env.SERVER_URL}+/api/event`)

useEffect(() => {
const fetchEvent = async () => {
const response = await axios.get(`${process.env.SERVER_URL}/api/event`);
const response = await axios.get(`${process.env.NEXT_PUBLIC_SERVER_URL}/api/event`);
setEvents(response.data);
};
fetchEvent();
Expand Down
5 changes: 5 additions & 0 deletions frontend-nextjs/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ import Team from "./components/Team";
import Client from "./components/Client";
import Contact from "./components/Contacts";
import Footer from "./components/Footer";
import { useEffect } from "react";

export default function Home(){
useEffect(() => {
console.log("env load",process.env.NEXT_PUBLIC_SERVER_URL)
}, [])

return(
<div>
<Navbar />
Expand Down
Loading