
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
This ia a ASGI proxy that proxies requests to Naja Atra.
Take uvicorn
as an example.
import uvicorn
There is a legacy application
from naja_atra import route
from naja_atra_asgi import app
@route("/hello")
def hello(name: str):
return {"messag": f"Hello, {name}!"}
if __name__ == '__main__':
uvicon_conf = uvicorn.Config(
app, host="0.0.0.0", port=9090, log_level="info")
asgi_server = uvicorn.Server(uvicon_conf)
asgi_server.run()
You can use server.scan()
to import routes from other modules. And also you can use naja_atra_asgi.config()
to function to sepecify the static resources routes.
import os
import uvicorn
import naja_atra.server as server
from naja_atra import route
from naja_atra_asgi import config, app
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
if __name__ == '__main__':
server.scan(base_dir="tests/ctrls", regx=r'.*controllers.*',
project_dir=PROJECT_ROOT)
config(
resources={"/public/*": f"{PROJECT_ROOT}/tests/static",
"/*": f"{PROJECT_ROOT}/tests/static"})
uvicon_conf = uvicorn.Config(
app, host="0.0.0.0", port=9090, log_level="info")
asgi_server = uvicorn.Server(uvicon_conf)
asgi_server.run()
You can use the legacy ASGI (V2) application function app_v2
if your server does not support ASGI V3.
FAQs
This is a simple http server, use MVC like design.
We found that naja-atra-asgi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.