Skip to content

Show Basic Idea on Web Page via ideate Web #54

@matthewctechnology

Description

@matthewctechnology

Summary

Show Basic Idea on Web Page via ideate Web

Description

Implement a server endpoint (GET /) using FastAPI that renders an HTML page displaying a hardcoded creative idea. Add test for route and ensure lint clean.

Proposal

  • Create backend/app.py (FastAPI)
  • Add GET / endpoint, serve template with hardcoded idea
  • Harden API endpoint against security and safety risks

Example

# FastAPI
from fastapi import FastAPI
from fastapi.responses import HTMLResponse

app = FastAPI()

@app.get("/", response_class=HTMLResponse)
async def root():
    """Serve hardcoded idea page"""
    return "<html><body>Invent an umbrella that changes color when it rains</body></html>"

Criteria

  • Given server is started, when GET / requested, then returns 200 and includes idea in page

Tests

  1. View README about backend
  • Displays backend run instructions
  1. Run cd /workspaces/stacked/ideate && source .ideate/bin/activate
  • Activates environment (.ideate)
  1. Run pylint ideate && pytest tests
  • Lint without errors
  • Tests without failures
  1. Run uvicorn ideate:app -reload
  • Starts backend app
  1. Request GET /
  • HTML shows default idea

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions