Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

naja-atra-wsgi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

naja-atra-wsgi

This is a simple http server, use MVC like design.

  • 1.0.2
  • PyPI
  • Socket score

Maintainers
1

Naja Atra WSGI

This ia a WSGI proxy that proxies requests to Naja Atra.

Usage

from naja_atra import route
from naja_atra_wsgi import app
from wsgiref.simple_server import make_server

@route("/hello")
def hello(name: str):
    return {"messag": f"Hello, {name}!"}

if __name__ == '__main__':
    server = make_server('0.0.0.0', 8080, app)
    server.serve_forever()

You can use server.scan() to import routes from other modules. And also you can use naja_atra_wsgi.config() to function to sepecify the static resources routes.

import os
import naja_atra.server as server

from wsgiref.simple_server import make_server
from naja_atra_wsgi import config, app

PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))

if __name__ == '__main__':
    
    server.scan(base_dir="tests/ctrls", regx=r'.*controllers.*')
    config(resources={"/public/*": f"{PROJECT_ROOT}/tests/static",
                    "/*": f"{PROJECT_ROOT}/tests/static"})

    wsgi_server = make_server("", 9090, app)
    wsgi_server.serve_forever()

Keywords

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc