1. Home
  2. /
  3. Supabase-edge-functions
  4. /
  5. Supabase Edge Function Returning HTML

Supabase Edge Function Returning HTML - Supabase-edge-functions Typing CST Test

Loading…

Supabase Edge Function Returning HTML — Supabase-edge-functions Code

Responds with a simple HTML page.

# supabase/demo/html.ts
import { serve } from 'https://deno.land/std@0.168.0/http/server.ts';

serve((_req) => {
	const html = '<!DOCTYPE html><html><body><h1>Hello HTML!</h1></body></html>';
	return new Response(html, { status: 200, headers: { 'Content-Type': 'text/html' } });
});

Supabase-edge-functions Language Guide

Supabase Edge Functions are serverless functions deployed at the edge using Deno runtime, enabling developers to run backend logic close to users with low latency.

Primary Use Cases

  • ▸RESTful API endpoints for Supabase apps
  • ▸Custom authentication or authorization flows
  • ▸Processing webhooks and events
  • ▸Serverless business logic triggered by frontend requests
  • ▸Realtime event handling and notifications

Notable Features

  • ▸Automatic scaling with traffic
  • ▸Runs on Deno runtime for secure execution
  • ▸Supports JavaScript and TypeScript
  • ▸Tight integration with Supabase ecosystem
  • ▸Edge-deployed for low-latency responses

Origin & Creator

Supabase Edge Functions were launched by Supabase in 2021 as part of their serverless edge platform.

Industrial Note

Supabase Edge Functions are optimized for developers looking to extend Supabase applications with serverless backend logic that runs near users worldwide.

More Supabase-edge-functions Typing Exercises

Simple Supabase Edge Function (TypeScript)Supabase Edge Function Returning JSONSupabase Edge Function with Query ParametersSupabase Edge Function Handling POST RequestSupabase Edge Function with Custom HeadersSupabase Edge Function Fetching External APISupabase Edge Function Using Environment VariableSupabase Edge Function Conditional ResponseSupabase Edge Function Redirect

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher