add API_URl env var to client
This commit is contained in:
parent
a838069472
commit
b48d1ea745
4 changed files with 11 additions and 1 deletions
1
client/.env
Normal file
1
client/.env
Normal file
|
@ -0,0 +1 @@
|
|||
API_URL=http://localhost:3000
|
|
@ -1,3 +1,6 @@
|
|||
const dotenv = require("dotenv");
|
||||
dotenv.config();
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
|
@ -8,7 +11,7 @@ const nextConfig = {
|
|||
return [
|
||||
{
|
||||
source: "/api/:path*",
|
||||
destination: "http://localhost:3000/:path*",
|
||||
destination: `${process.env.API_URL}/:path*`,
|
||||
},
|
||||
];
|
||||
},
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"@geist-ui/core": "^2.3.5",
|
||||
"@geist-ui/icons": "^1.0.1",
|
||||
"comlink": "^4.3.1",
|
||||
"dotenv": "^16.0.0",
|
||||
"next": "12.1.0",
|
||||
"prismjs": "^1.27.0",
|
||||
"react": "17.0.2",
|
||||
|
|
|
@ -537,6 +537,11 @@ doctrine@^3.0.0:
|
|||
dependencies:
|
||||
esutils "^2.0.2"
|
||||
|
||||
dotenv@^16.0.0:
|
||||
version "16.0.0"
|
||||
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.0.tgz#c619001253be89ebb638d027b609c75c26e47411"
|
||||
integrity sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==
|
||||
|
||||
emoji-regex@^9.2.2:
|
||||
version "9.2.2"
|
||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72"
|
||||
|
|
Loading…
Reference in a new issue