diff --git a/next.config.js b/next.config.js index 1ffa013..97a28c4 100644 --- a/next.config.js +++ b/next.config.js @@ -6,6 +6,13 @@ const nextConfig = { return config; }, + output: 'export', + images: { + unoptimized: true + }, + exportPathMap: async (defaultMap, ctx) => { + return defaultMap + } // basePath: '/github-pages', } diff --git a/pages/api/contact.ts b/pages/api/contact.ts index 871cead..2167918 100644 --- a/pages/api/contact.ts +++ b/pages/api/contact.ts @@ -74,7 +74,9 @@ export default async function handler( transporter.sendMail(mailData, function (err, info) { if(err) { console.log(err); - res.status(500).send('Internal Server Error'); + // res.status(500).send('Internal Server Error'); + res.status(500).end(); + } else { console.log('successful'); @@ -86,11 +88,13 @@ export default async function handler( res.status(200).json(req.body); } else { // reCAPTCHA verification failed - res.status(400).send('reCAPTCHA verification failed.'); + // res.status(400).send('reCAPTCHA verification failed.'); + res.status(400).end(); } } catch (error) { console.error(error); - res.status(500).send('Internal server error'); + // res.status(500).send('Internal server error'); + res.status(500).end(); } diff --git a/pages/index.tsx b/pages/index.tsx index 2bc3506..dbbf667 100755 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -11,8 +11,8 @@ import Link from 'next/link'; const inter = Inter({ subsets: ['latin'] }) export default function Home() { - const contactFormSectionRef = useRef(null); - const landingSectionRef = useRef(null); + const contactFormSectionRef = useRef(null); + const landingSectionRef = useRef(null); const [contactClicked, setContactClicked] = useState(false); const customStyles = {