- Copy
.env.example
and rename to.env.[NODE_ENV]
P.S ifNODE_ENV
is not specified, default loading.env.local
NEXT_PUBLIC_API_ENDPOINT=backend endpoint
NEXT_PUBLIC_CONTRACT_ADDRESS=contract address
For vercel deployment, please refer to this page to set env. variables
- Add CORS rule on the backend
const corsOptions = {
origin: [
// localhost
"http://localhost:3000",
// ...
],
optionsSuccessStatus: 200
};
app.use(cors(corsOptions));
- Install packages and run
yarn
# dev
yarn dev
# build
yarn build
yarn start