fix: changer le pattern de route newsletter (api/ réservé par Kirby)

- Pattern `api/newsletter` → `newsletter/subscribe`
- Ajout de config.localhost.php (gitignored) pour le dev local

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-02-27 15:18:29 +01:00
parent 9c9a2fd40a
commit c34a564aa5
3 changed files with 3 additions and 2 deletions

1
.gitignore vendored
View file

@ -53,6 +53,7 @@ Icon
# --------------- # ---------------
/site/config/config.index.ngo.php /site/config/config.index.ngo.php
/site/config/config.localhost.php
# Content # Content

View file

@ -1,7 +1,7 @@
(function () { (function () {
'use strict'; 'use strict';
const PROXY_URL = '/api/newsletter'; const PROXY_URL = '/newsletter/subscribe';
async function subscribeToNewsletter(email, attributes = {}) { async function subscribeToNewsletter(email, attributes = {}) {
const response = await fetch(PROXY_URL, { const response = await fetch(PROXY_URL, {

View file

@ -1,7 +1,7 @@
<?php <?php
return [ return [
'pattern' => 'api/newsletter', 'pattern' => 'newsletter/subscribe',
'method' => 'POST|OPTIONS', 'method' => 'POST|OPTIONS',
'action' => function () { 'action' => function () {
header('Content-Type: application/json'); header('Content-Type: application/json');