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
- View README about backend
- Displays backend run instructions
- Run
cd /workspaces/stacked/ideate && source .ideate/bin/activate
- Activates environment (.ideate)
- Run
pylint ideate && pytest tests
- Lint without errors
- Tests without failures
- Run
uvicorn ideate:app -reload
- Request
GET /
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
Example
Criteria
GET /requested, then returns 200 and includes idea in pageTests
cd /workspaces/stacked/ideate && source .ideate/bin/activatepylint ideate && pytest testsuvicorn ideate:app -reloadGET /