Replies: 2 comments
-
Hello. Have you tried regex routes? Sisk itself doens't has something built-in to handle route wildcards. You'll need regex routes for that: using var host = HttpServer.CreateBuilder ( 7775 )
.UseConfiguration ( config => {
config.AccessLogsStream = null;
} )
.UseRouter ( router => {
router += new RegexRoute ( RouteMethod.Get, @"/content/(?<pathcontents>.*)", request => {
string pathContents = request.RouteParameters [ "pathcontents" ].GetString ();
// do something with PathContents
return new HttpResponse ();
} );
} )
.Build (); Also, I saw that this doc section is outdated. Regex group values is not added to |
Beta Was this translation helpful? Give feedback.
0 replies
-
Perfect, thanks! :-) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I want to have a route that reacts, for example, to /content/ and everything that comes after it, i.e. the route should respond to:
/content/
/content/index.html
/content/css/styles.css
/content/subdir/anotherdir/file.png
I haven't found a way to implement this. Is this already possible, or would it be possible to add it by using some wildcard that applies to arbitrarily divided paths? I've always just found ways to react to everything on one level. But I don't know how many sublevels there will be.
Beta Was this translation helpful? Give feedback.
All reactions