Skip to content

Commit 6a9a6e3

Browse files
committed
5.7.7 - default app and redirect tweaks
1 parent b53c9d2 commit 6a9a6e3

File tree

8 files changed

+16
-12
lines changed

8 files changed

+16
-12
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
7878
- run: |
7979
mk python-release owner=vkottler \
80-
repo=runtimepy version=5.7.6
80+
repo=runtimepy version=5.7.7
8181
if: |
8282
matrix.python-version == '3.12'
8383
&& matrix.system == 'ubuntu-latest'

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
=====================================
33
generator=datazen
44
version=3.1.4
5-
hash=41ff8742602f69f2831092a4b666cddc
5+
hash=0bf47d2ff3fb0ed78ed013f4fcbc59e2
66
=====================================
77
-->
88

9-
# runtimepy ([5.7.6](https://pypi.org/project/runtimepy/))
9+
# runtimepy ([5.7.7](https://pypi.org/project/runtimepy/))
1010

1111
[![python](https://img.shields.io/pypi/pyversions/runtimepy.svg)](https://pypi.org/project/runtimepy/)
1212
![Build Status](https://github.com/vkottler/runtimepy/workflows/Python%20Package/badge.svg)

local/variables/package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
major: 5
33
minor: 7
4-
patch: 6
4+
patch: 7
55
entry: runtimepy

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__"
44

55
[project]
66
name = "runtimepy"
7-
version = "5.7.6"
7+
version = "5.7.7"
88
description = "A framework for implementing Python services."
99
readme = "README.md"
1010
requires-python = ">=3.11"

runtimepy/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# =====================================
22
# generator=datazen
33
# version=3.1.4
4-
# hash=cab7cff2cb194a61178fa386b80eae85
4+
# hash=ed12f307211d1317e3ce6a7c4409b97f
55
# =====================================
66

77
"""
@@ -10,7 +10,7 @@
1010

1111
DESCRIPTION = "A framework for implementing Python services."
1212
PKG_NAME = "runtimepy"
13-
VERSION = "5.7.6"
13+
VERSION = "5.7.7"
1414

1515
# runtimepy-specific content.
1616
METRICS_NAME = "metrics"

runtimepy/data/server_base.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ init:
1616
config:
1717
# Default redirects.
1818
http_redirects:
19-
"/": "/app.html"
19+
"/": "/index.html"
2020
"/index.html": "/app.html"
2121

22+
# Serve these applications by default at these paths.
23+
http_app_paths: ["/", "/app.html", "/index.html"]
24+
2225
servers:
2326
- factory: runtimepy_http
2427
kwargs: {port: "$runtimepy_http_server"}

runtimepy/net/server/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ async def get_handler(
272272
return self.favicon_data
273273

274274
# Try serving a file and handling redirects.
275-
for handler in [self.try_redirect, self.try_file]:
275+
for handler in [self.try_file, self.try_redirect]:
276276
result = await handler(
277277
request.target.origin_form, response
278278
)

runtimepy/net/server/app/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ async def setup(app: AppInfo) -> int:
6969
)
7070

7171
# Default application (environment tabs).
72-
RuntimepyServerConnection.apps["/app.html"] = create_app(
73-
app, getattr(_import_module(module), method)
74-
)
72+
html_app = create_app(app, getattr(_import_module(module), method))
73+
target: str
74+
for target in app.config_param("http_app_paths", []):
75+
RuntimepyServerConnection.apps[target] = html_app
7576

7677
# Register redirects.
7778
redirects: dict[str, str] = app.config_param("http_redirects", {})

0 commit comments

Comments
 (0)