Files
PersonalBlog/js/newsletter-config.js
T
bot-implementer 24db5b8a50 feat: add serverless newsletter signup page
Adds newsletter.html with an email signup form that POSTs to a configured
serverless endpoint. The endpoint and API token live in
js/newsletter-config.js (token defaults to an empty deploy-time placeholder,
never hardcoded in page logic). Missing/invalid tokens and network failures
surface a fixed user-safe error; successful signups show a confirmation.
Links the page from the site navigation on all pages.
2026-08-25 19:15:56 +00:00

18 lines
738 B
JavaScript

/**
* Newsletter signup configuration.
*
* The blog is a static site with no build step, so the serverless endpoint
* and its API token are configured here — edit this file when deploying.
*
* Security note: a real API token must NEVER be committed to the repository.
* The committed default below is intentionally empty; the deployer fills in
* the token at deploy time (and only then). The page logic reads the token
* from this module and never hardcodes one.
*/
/** The serverless endpoint the signup form POSTs to. */
export const NEWSLETTER_ENDPOINT = "https://example.com/api/newsletter-subscribers";
/** API token for the endpoint. Empty by default — set at deploy time. */
export const NEWSLETTER_API_TOKEN = "";