diff --git a/.env b/.env new file mode 100644 index 0000000..1ec63f6 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +NEXT_PUBLIC_API_URL=$TODO_LOOPBACK \ No newline at end of file diff --git a/app/login/components/LoginForm.tsx b/app/login/components/LoginForm.tsx index 1106ddc..631a57d 100644 --- a/app/login/components/LoginForm.tsx +++ b/app/login/components/LoginForm.tsx @@ -21,7 +21,6 @@ const LoginForm = () => { setValues({ ...values, [name]: value }); }; const handleSubmit = async (e: React.FormEvent) => { - console.log(apiUrl); e.preventDefault(); try { const res = await fetch(`${apiUrl}/users/login`, { diff --git a/next.config.js b/next.config.js index 767719f..bd8adf9 100644 --- a/next.config.js +++ b/next.config.js @@ -1,4 +1,9 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {} +require("dotenv").config(); +const nextConfig = { + publicRuntimeConfig: { + NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL, + }, +}; -module.exports = nextConfig +module.exports = nextConfig; diff --git a/package.json b/package.json index 26b1e97..d6889de 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^1.9.5", "autoprefixer": "^10.4.15", + "dotenv": "^16.3.1", "next": "^13.4.19", "next-redux-wrapper": "^8.1.0", "postcss": "^8.4.29", diff --git a/yarn.lock b/yarn.lock index b1eac4a..0d59f6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,6 +14,11 @@ dependencies: regenerator-runtime "^0.14.0" +"@heroicons/react@^2.0.18": + version "2.0.18" + resolved "https://registry.yarnpkg.com/@heroicons/react/-/react-2.0.18.tgz#f80301907c243df03c7e9fd76c0286e95361f7c1" + integrity sha512-7TyMjRrZZMBPa+/5Y8lN0iyvUU/01PeMGX2+RE7cQWpEUIcb4QotzUObFkJDejj/HUH4qjP/eQ0gzzKs2f+6Yw== + "@jridgewell/gen-mapping@^0.3.2": version "0.3.3" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" @@ -308,6 +313,11 @@ dlv@^1.1.3: resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79" integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA== +dotenv@^16.3.1: + version "16.3.1" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e" + integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== + electron-to-chromium@^1.4.477: version "1.4.513" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.513.tgz#41a50bf749aa7d8058ffbf7a131fc3327a7b1675" @@ -829,6 +839,11 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +sweetalert2@^11.10.0: + version "11.10.1" + resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-11.10.1.tgz#783e18c90bcde72039e26e4b943573e83cf55afe" + integrity sha512-qu145oBuFfjYr5yZW9OSdG6YmRxDf8CnkgT/sXMfrXGe+asFy2imC2vlaLQ/L/naZ/JZna1MPAY56G4qYM0VUQ== + tailwindcss@^3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.3.3.tgz#90da807393a2859189e48e9e7000e6880a736daf"