Urgent.News

What's breaking now, across thousands of outlets.

Tech

Adding emoji reactions to your Astro blog with Netlify Blobs

Original post: Adding emoji reactions to your Astro blog with Netlify Blobs Comments ask a lot of a reader. Reactions ask almost nothing, a single click and a second of intent. That asymmetry is what makes them worth adding: most readers who found your post useful will never write a comment, but many of them will click a heart or a lightbulb if you make it easy enough. This post covers the full…

Adding emoji reactions to your Astro blog with Netlify Blobs allows readers to express their appreciation with a simple click, without the commitment of leaving a comment. This feature provides value to most visitors who find the post helpful, yet rarely engage through comments. To implement this functionality, Netlify Blobs is utilized as a managed key-value store, requiring no database setup or management.

Local development relies on the explicit fallback values for NETLIFY_SITE_ID and either NETLIFY_AUTH_TOKEN or NETLIFY_PAT in the .env file. The package @netlify/blobs is installed using pnpm add @netlify/blobs. The serverless function, located at netlify/functions/reactions.ts, manages three HTTP methods: GET for fetching reaction counts, POST for recording a reaction, and OPTIONS for CORS preflight.

The function employs various regular expressions and conditional checks to validate incoming requests and establish appropriate CORS headers.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Apple will let EU apps use less alarming tracking consent screens

Apple is changing its App Tracking Transparency prompts in parts of Europe after competition regulators said the system favored Apple over third-party apps, giving developers more flexibility over how…

  • Apple to modify ATT consent screens for EU markets
  • Screens to appear as full-page, less intimidating
  • Developers can provide detailed data usage info via link

The PoC Environment Nobody Kills

Six months ago, a proof of concept shipped. Someone spun up a PoC environment to prove it could work: a small cluster, a database, maybe a load balancer if the demo needed to look convincing.

  • PoC environment remains operational despite no clear purpose
  • Idle non-production environments account for 27% of cloud spend
  • Turning idle environments into scale-to-zero mode could cut waste by 95%

More from Thursday 17 September →