I have a project made with React/Next.js.
This is the file directories.
What I am trying to do is have the user GET - /api/grademate/pay and return the success page.
Fetching /api/grademate/pay works without a problem.
The problem is, while testing, the success page does not load when I try to visit it manually.
This is what my index.js file looks like inside the success folder:
import Head from 'next/head'
import Image from 'next/image'
import styles from '../../../../styles/Home.module.css'
export default function Success() {
return (
<div className={styles.container}>
<Head>
<title>Payment Success</title>
<meta name="description" content="Your payment was successful!" />
<link rel="icon" href="/favicon.ico" />
</Head>
<main className={styles.main}>
<h1 className={styles.title}>
Payment Successful!
</h1>
</main>
</div>
)
}
When I try to visit /api/grademate/pay/success, nothing happens and the page just loads and this error is printed:
API resolved without sending a response for /api/grademate/success, this may result in stalled requests.
Keep in mind I am new to the world of React and Next.js
