Reactjs – Post request server side Next Js
im quite new to react and next js, i can do server side get request just fine, it is pretty simple. i just wanted to know how to execute a post request to an external api in NextJs server side,…
im quite new to react and next js, i can do server side get request just fine, it is pretty simple. i just wanted to know how to execute a post request to an external api in NextJs server side,…
Im deploying my Nextjs 14 app in AWS EC2 using AWS CLI, Docker, Github. For authentication i use next-auth. Every time user get access sucessfully Next auth redirects it to localhost. .env Dockerfile: FROM node:21 as builder WORKDIR /app COPY…
I am trying to fetch data to my dashboard component in SSR but get undefined Are there any solution to fetch data properly? Here is my code of Dashboard component: import Container from "./Container"; import { getServerSession } from "next-auth/next";…
My webpage requires to reload every time to update user state. As to the problem, in the handleLogin func, the page should be redirected to homepage ('/') and refresh itself, so that the user state is updated, due to AuthContextProvider…
i am build nextjs project and creating table from material ui and fetching data from mongoDB. i want to add two button on action (edit and delete) column but dont know how to do it on material MUI i want…
I have a front end call to an api that works well: login= useUser() ; const handleSubmit = async (e: any) => { e.preventDefault(); setLoading((loading) => !loading); setResult(''); const login = useUser() console.log('submitted form') try { login(email,password)//subsitute i'de like to…
i am build nextjs project and creating table from material ui and fetching data from mongoDB. how to manipulate the data from the table. i want # columns auto increment start from 1,2,3,4,5 etc. every row. and this is my…
Like some many other answers stated, e.g. this one, Next.js runs both on the client as well as on the server, so you need a guard to be able to properly fetch from localStorage: if (typeof localStorage !== "undefined") {…
Please assist, I have a Next.js project and want to import a file from another folder into my main app. Please assist me with the correct syntax, paths etc.. I am getting the following error, see screenshot below following by…
Suddenly my Node environments start not to install packages and they are freezing in idealTree:my-app : sill idealTree buildDeps I tried npm config set registry http://registry.npmjs.org/ --global but did not work, I had to use npm set strict-ssl false to…