Updated site completely
Some checks failed
GitHub Actions / build (18) (push) Has been cancelled
GitHub Actions / build (20) (push) Has been cancelled
GitHub Actions / build (22) (push) Has been cancelled
GitHub Actions / check (push) Has been cancelled

This commit is contained in:
becarta
2025-03-29 22:32:31 +01:00
parent a9adf1bb4f
commit 890d7b8670
56 changed files with 1807 additions and 1299 deletions

View File

@@ -0,0 +1,30 @@
import { JSDOM } from 'jsdom';
import createDOMPurify from 'dompurify';
export const handler = async (event) => {
try {
const data = JSON.parse(event.body);
const DOMPurify = createDOMPurify(new JSDOM('').window);
// Sanitize user input
const sanitizedData = {
name: DOMPurify.sanitize(data.name),
email: DOMPurify.sanitize(data.email),
message: DOMPurify.sanitize(data.message),
};
// TODO: Process the sanitized data (e.g., send an email)
console.log('Sanitized data:', sanitizedData);
return {
statusCode: 200,
body: JSON.stringify({ message: 'Form submitted successfully!' }),
};
} catch (error) {
console.error('Error:', error);
return {
statusCode: 500,
body: JSON.stringify({ message: 'An error occurred.' }),
};
}
};