All Questions
193 questions
-3
votes
0
answers
61
views
Express route /api/test returns 404 Not Found even though it’s defined
I have a simple Express server listening on port 5002. In my server.js I’ve defined a test endpoint:
// server.js
import express from 'express';
import cors from 'cors';
const app = express();
app....
0
votes
1
answer
100
views
CORS Issue When Using External Service for API Calls in Next.js"
I am encountering an issue with Next.js that I don't quite understand. I have a service file that I want to use to make API calls faster and more structured. However, when I call the API via this ...
2
votes
0
answers
38
views
Client side request for monero-wallet-rpc with credentials
I wonder how to create a axios request from client side for monero-wallet-rpc with --rpc-login credentials because all of my tries are failing with response status code 401. Below is my sample command ...
0
votes
0
answers
52
views
Fetching data with axios/server actions/authentication cookies
I have a REST API/Express + NodeJS (backend) and a Client Site/NextJS(frontend) and the authentication between them is done through JWT.
My REST API returns accessToken and refreshToken through ...
1
vote
3
answers
303
views
Issue with Replicate.ai API Returning ReadableStream Instead of Image URL in Next.js
I'm working on a Next.js project that generates images using the Replicate.ai API. Although images are generated correctly on the Replicate.ai dashboard, the API response in my Next.js serverless ...
-1
votes
1
answer
46
views
How do I get the cookies without having to pass them to API functions from server components?
I can get the cookies in server side components and pass them to API functions like this:
import { cookies } from 'next/headers';
const cookieStore = cookies();
const sessionId = cookieStore.get('...
0
votes
1
answer
342
views
Redirect to login page when responses are 401 in Next js
I use next js middleware which redirects user to the login page only If there is no token available in middleware.ts:
import type { NextRequest, NextResponse } from "next/server";
export ...
1
vote
2
answers
269
views
Nextjs API works in local environment but not in production
I have created a blog project using Next. When posting a new article, the API route is called with axios and the article is created in my database (MongoDB).
Everything works fine in local ...
0
votes
1
answer
283
views
Logout User from axios response interceptor for server-component
Here I have implemented axios interceptors for nextjs 14 application. And need help to logout user if any error occurs and redirect user to '/login' page.
I am attaching interceptors code here.
...
0
votes
0
answers
102
views
Axios Requests to Rails Backend Returning 404 Instead of JSON Data
I'm working on a project where I have a Next.js frontend and a Rails backend. When I use Postman to make a GET request to http://localhost:3000/books, it works perfectly and returns the expected JSON ...
0
votes
0
answers
371
views
Creating a table in Next Js
I have a request that displays users and their metadata to the console. How can I make it appear in a table on the website (in return())
This is my code:
const apiKey = process.env.CLERK_SECRET_KEY; //...
0
votes
0
answers
111
views
nextjs unable to call API when deploy to network: [ERROR]: connect EHOSTUNREACH
I have an SSR todo app that I can run the app properly at localhost with no issue, but when I deployed it to the Truenas Scale, it couldn't call the API when getting the data using getServerSideProps()...
-1
votes
1
answer
681
views
Next.js 14: Client-side data fetching not working (user profile data)
I'm encountering an issue with client-side data fetching in my Next.js 14 application. Specifically, I'm attempting to fetch user profile data from a backend API using Axios within a component, but ...
2
votes
2
answers
402
views
How to display error body on front end using axios
My fast api end point is here:
@app.post("/api/signup", status_code=status.HTTP_200_OK)
async def signup( credentials : signupcred ):
try:
print(credentials.email, credentials....
1
vote
0
answers
72
views
Nextjs ServerSide how to revalidate expired jwt token?
I am revalidating jwt token onece it expired and I don't have any idea how to do this on nextjs server side. here my jwt revalidate code:
function getAuthTokenFromCookie() {
const cookieString = ...