mirror of
https://github.com/matze/wastebin.git
synced 2026-04-25 08:36:00 +03:00
[PR #48] [MERGED] Handle serving from a sub-path #131
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/wastebin-matze#131
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/matze/wastebin/pull/48
Author: @aldur
Created: 2/12/2024
Status: ✅ Merged
Merged: 2/25/2024
Merged by: @matze
Base:
master← Head:handle_base_path📝 Commits (5)
3dfe1ecIteration #1: Handle serving from a sub-path63ee34cOne moremeta.base_pathcbb71a1AddBasePathnewtype and cleanup8208277Fix string interpolationa025b0fAdd tests for base_path📊 Changes
17 files changed (+138 additions, -54 deletions)
View changed files
📝
.github/workflows/rust.yml(+1 -0)📝
src/env.rs(+53 -0)📝
src/highlight.rs(+1 -1)📝
src/id.rs(+1 -1)📝
src/main.rs(+13 -8)📝
src/pages.rs(+12 -0)📝
src/routes/assets.rs(+2 -1)📝
src/routes/form.rs(+9 -7)📝
src/routes/json.rs(+3 -1)📝
src/routes/mod.rs(+25 -19)📝
src/routes/paste.rs(+2 -1)📝
src/test_helpers.rs(+2 -1)📝
templates/base.html(+3 -3)📝
templates/burn.html(+1 -1)📝
templates/error.html(+1 -1)📝
templates/index.html(+1 -1)📝
templates/paste.html(+8 -8)📄 Description
Hi there! 👋
I took a shot at letting
wastebinwork when served from a sub-path (e.g. https://example.com/wastsebin/). It's a WIP, but I thought of getting this out early and discuss 1. if useful; 2. improvements.The idea is to re-use the
WASTEBIN_BASE_URLvariable and get itspathcomponent (if any).Right now:
What's the best approach to add the test? Duplicate them? Run them in a
forloop with / without the sub-path?Also, I am not convinced of storing the base path in the
metadataas a static variable. Are there other approaches?🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.