From 8d462dedfa010a3b77317a933965783721050a88 Mon Sep 17 00:00:00 2001 From: CalDescent Date: Tue, 28 Mar 2023 19:18:21 +0100 Subject: [PATCH] Added routing info to documentation. --- Q-Apps.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Q-Apps.md b/Q-Apps.md index 6f76a0f3..1dbb72de 100644 --- a/Q-Apps.md +++ b/Q-Apps.md @@ -87,6 +87,16 @@ Note that QDN is a permissionless system, and therefore it's not possible to ver To update a resource, it can be overwritten by publishing with the same `name`, `service`, and `identifier` combination. Note that the authenticated account must currently own the name in order to publish an update. +## Routing + +If a non-existent `filepath` is accessed, the default behaviour of QDN is to return a `404: File not found` error. This includes anything published using the `WEBSITE` service. + +However, routing is handled differently for anything published using the `APP` service. + +For apps, QDN automatically sends all unhandled requests to the index file (generally index.html). This allows the app to use custom routing, as it is able to listen on any path. If a file exists at a path, the file itself will be served, and so the request won't be sent to the index file. + +It's recommended that all apps return a 404 page if a request isn't able to be routed. + # Section 1: Simple links and image loading via HTML