Skip to content

How to resolve relative routes #3021

Closed Answered by HugeLetters
HugeLetters asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah ok, I think I've figured it out

 .get(':p{.*}', (c) => {
      const url = c.req.path.replace(c.req.param('p') ?? '', '');
      return c.render(
        <div>
          not found. <a href={url}>go to homepage</a>
        </div>,
      );
    })

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@HugeLetters
Comment options

Answer selected by HugeLetters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant