Files
risk-calc/app/main.py

32 lines
997 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from jinja2 import Environment, FileSystemLoader
app = FastAPI(
openapi_url=None,
docs_url=None,
redoc_url=None,
)
env = Environment(
loader=FileSystemLoader(
searchpath='./templates',
),
enable_async=True,
)
@app.get('/')
async def function():
template = env.get_template('main.jinja2')
return HTMLResponse(
content=await template.render_async(
title='Калькулятор рисков',
description='Матрица n×m: игры с природой. Матрица 2×2: аналитический и графический методы.',
keywords='калькулятор,теория рисков,теория игр,матрица,игры с природой,критерии,аналитический метод,графический метод',
robots='all',
),
status_code=200,
)