One package
Nyx is a Nox package, not a second compiler. Add it under requires, then import nyx.app.
↑↓ to move · Enter to open · Esc to close
0.22.0
Web framework
Rails-scoped web apps, written in Nox.
Application lifecycle, models, sessions, jobs and mail. Typed APIs, one SQLite file by default, the same deploy path as noxlang.com.
noxc install github.com/mburakmmm/nyx@v0.22.0Nox ≥ 2.0.7. The language itself is documented at noxlang.com.
import nox.http
from nox.http import HttpRequest, HttpResponse
from nox.router import Context
import nyx.app
import nyx.config
import nyx.ctrl
import nyx.ctx
from nyx.app import Application
from nyx.config import Config
from nyx.ctx import AppContext
def setup(application: Application) -> None:
def home(ctx: Context) -> HttpResponse:
ac: AppContext = nyx.ctx.wrap(application, ctx)
context: dict[str, str] = {}
context["title"] = "Hello"
context["env"] = ac.config().env
return nyx.ctrl.render(200, "app/views/home.html", context)
application.router.get("/", home)
cfg: Config = nyx.config.load()
application: Application = nyx.app.boot(cfg, setup)
def handle(req: HttpRequest) -> HttpResponse:
return nyx.app.dispatch(application, req)
nox.http.serve(8080, handle)Shape
Nyx is the full-stack web framework for Nox. It covers the Rails problem space: boot, routing, views, models, security and background work.
Nyx is a Nox package, not a second compiler. Add it under requires, then import nyx.app.
New code builds rows with Attributes. JSON-string create and update stay for older apps.
Call nyx.app.boot at module scope and close handlers over the Application inside setup.
Surface
nyx.app, config, runtime, ctx
routes, views, forms, params
SQLite, Postgres and MySQL models
sessions, CSRF, auth, JWT, CSP
This site is a Nyx application on the same Cloudflare tunnel as noxlang.com. The language reference stays on the Nox site.