mirror of
https://github.com/j93es/oauth-backend.git
synced 2026-06-04 06:51:51 +09:00
러스트가 좋아서 데이트하러감
This commit is contained in:
parent
f28fbc42dd
commit
fcc0b6d2f3
1 changed files with 23 additions and 0 deletions
23
runner/backend/__init__.py
Normal file
23
runner/backend/__init__.py
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
from fastapi import FastAPI, Query, HTTPException
|
||||||
|
from fastapi.responses import Response
|
||||||
|
import lib.target as target
|
||||||
|
|
||||||
|
app = FastAPI()
|
||||||
|
|
||||||
|
|
||||||
|
@app.post("/start")
|
||||||
|
async def start(url: str = Query(None)):
|
||||||
|
if url:
|
||||||
|
target.save(url)
|
||||||
|
print(f"Target URL set to: {url}")
|
||||||
|
return {"message": f"Target URL set to: {url}"}
|
||||||
|
return {"error": "No URL provided"}
|
||||||
|
|
||||||
|
|
||||||
|
@app.exception_handler(404)
|
||||||
|
async def not_found_handler(request, exc):
|
||||||
|
return Response(status_code=404)
|
||||||
|
|
||||||
|
@app.exception_handler(405)
|
||||||
|
async def method_not_allowed_handler(request, exc):
|
||||||
|
return Response(status_code=405)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue