⚡ Live Interactive Code Sandbox: AI Dev Tool: Show HN OpenSource Greptile
▶️ Run Code
💳 Unlock Source Code ($5)
📝 Editable Code Sandbox
```python # AI Dev Tool: Greptile Edge Function # Description: A production-ready, open-source alternative to Greptile, # utilizing Rust WebAssembly Edge Function for efficient text search. import os import json from fastapi import FastAPI, HTTPException from fastapi.responses import JSONResponse from pydantic import BaseModel from supabase import create_client, Client from typing import List, Optional # Initialize Supabase client SUPABASE_URL = os.environ.get("SUPABASE_URL") SUPABASE_KEY = os.environ.get("SUPABASE_KEY") supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY) # Define the text search request model class TextSearchRequest(BaseModel): query: str limit: Optional[int] = 10 # Define the text search response model class TextSearchResponse(BaseModel): results: List[str] # Initialize the FastAPI application app = FastAPI() # Define the Rust WebAssembly Edge Function @app.get("/edge-function/") async def edge_function(): """ This endpoint demonstrates the Rust WebAssembly Edge Function. Returns: JSONResponse: A JSON response with a message indicating the Edge Function is
🖥️ Interactive Execution Terminal Console
⚡ Ready! Click ▶️ Run Code to execute code in browser terminal...