- fixed issues surrounding next export of static assets

- hostable as static files now
This commit is contained in:
oonyeje 2024-01-10 10:40:18 -05:00
parent ace17bf7c7
commit c3721bfb31
3 changed files with 16 additions and 5 deletions

View File

@ -6,6 +6,13 @@ const nextConfig = {
return config;
},
output: 'export',
images: {
unoptimized: true
},
exportPathMap: async (defaultMap, ctx) => {
return defaultMap
}
// basePath: '/github-pages',
}

View File

@ -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();
}

View File

@ -11,8 +11,8 @@ import Link from 'next/link';
const inter = Inter({ subsets: ['latin'] })
export default function Home() {
const contactFormSectionRef = useRef<Element>(null);
const landingSectionRef = useRef<Element>(null);
const contactFormSectionRef = useRef<HTMLDivElement>(null);
const landingSectionRef = useRef<HTMLDivElement>(null);
const [contactClicked, setContactClicked] = useState(false);
const customStyles = {