Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
command = "npm run build"
publish = "dist/portfolio/browser"

[[redirects]]
from = "/api/contact"
to = "/.netlify/functions/contact"
status = 200
force = true

[[redirects]]
from = "/*"
to = "/index.html"
Expand Down
1 change: 0 additions & 1 deletion netlify/functions/contact.mts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ export function createContactHandler(
export default createContactHandler();

export const config = {
path: '/api/contact',
rateLimit: {
windowLimit: 5,
windowSize: 180,
Expand Down
3 changes: 1 addition & 2 deletions netlify/tests/contact.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,8 @@ describe('Netlify contact function', () => {
expect(response.headers.get('allow')).toBe('POST');
});

it('maps the function to /api/contact with native per-IP rate limiting', () => {
it('configures native per-IP rate limiting', () => {
expect(config).toEqual({
path: '/api/contact',
rateLimit: {
windowLimit: 5,
windowSize: 180,
Expand Down