9 Commits

Author SHA1 Message Date
921a784fc0 add webservice boilerplate snippet
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-07-14 17:58:43 +02:00
43678c69fb hidden imports, 9 2025-07-14 16:55:56 +02:00
4577f8f0a5 hidden imports, 8 2025-07-14 16:49:32 +02:00
4dd3e9e799 hidden imports, 7 2025-07-14 16:40:35 +02:00
46ce0e1d54 hidden imports, 6 2025-07-14 16:37:16 +02:00
07b5a2a512 hidden imports, 5 2025-07-14 16:32:22 +02:00
d30abf3d0c hidden imports, 4 2025-07-14 16:28:23 +02:00
f8061aaa7a hidden imports, 3 2025-07-14 16:23:01 +02:00
e1cce96308 hidden imports, 2 2025-07-14 16:18:08 +02:00
4 changed files with 50 additions and 1 deletions

View File

@@ -111,7 +111,16 @@ build-windows-binary:
.\venv\Scripts\pip.exe install -r dependencytrack-client\requirements.txt
.\venv\Scripts\pip.exe install -r defectdojo-client\requirements.txt
.\venv\Scripts\pip.exe install pyinstaller
.\venv\Scripts\pyinstaller.exe --onefile --add-data "dependencytrack-client;dependencytrack-client" --add-data "defectdojo-client;defectdojo-client" --hidden-import pydantic sbom-dt-dd.py
.\venv\Scripts\pyinstaller.exe --onefile `
--add-data "dependencytrack-client;dependencytrack-client" `
--add-data "defectdojo-client;defectdojo-client" `
--hidden-import pydantic `
--hidden-import dateutil.parser `
--hidden-import urllib3 `
--hidden-import regex `
--collect-data cyclonedx `
--collect-data license_experssion `
sbom-dt-dd.py
mv dist\sbom-dt-dd.exe ..

33
snippets/websrv/main.py Normal file
View File

@@ -0,0 +1,33 @@
from fastapi import FastAPI
from fastapi.responses import JSONResponse
app = FastAPI(
title="My FastAPI App",
version="1.0.0",
description="A simple FastAPI example with uvicorn and gunicorn."
)
@app.get("/hello")
async def say_hello(name: str):
"""
Returns a friendly greeting.
---
parameters:
- name: name
in: query
required: true
schema:
type: string
responses:
200:
description: Successful Response
content:
application/json:
schema:
type: object
properties:
message:
type: string
"""
return JSONResponse(content={"message": f"Hello, {name}!"})

View File

@@ -0,0 +1,3 @@
fastapi==0.116.1
gunicorn==23.0.0
uvicorn==0.35.0

4
snippets/websrv/server.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
./.venv/bin/gunicorn main:app -k uvicorn.workers.UvicornWorker -w 4 -b 0.0.0.0:8000