打开Redwoodjs的绝对URL -SSR

发布于 2025-02-08 08:28:05 字数 358 浏览 2 评论 0原文

我有一个带有几条路线的Redwoodjs应用程序。 现在是非常基本的,我使用Yarn RW Dev启动开发服务器。

现在我创建了一些路线:

/ -> HomePage
/sign-in -> SignInPage
/register -> RegisterPage

我可以通过navigate内部调用路由,该路由正常。但是我无法通过localhost:8910/寄存器来调用这些路由。我遇到了404错误。

我该怎么做才能(几乎)使用它们的绝对URL直接可召唤所有路线?

I have a RedwoodJS App with several routes.
It's very basic for now and I start the development server with yarn rw dev.

Now I have created some routes:

/ -> HomePage
/sign-in -> SignInPage
/register -> RegisterPage

I can call the routes internally via navigate which works fine. But I cannot call these routes via localhost:8910/register for example. I get a 404 error.

What do I have to do to make (almost) all routes callable directly with their absolute urls?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

少女的英雄梦 2025-02-15 08:28:05

对您的问题的较晚回答,但是所有路由都在routes.tsx -file中管理。在我的示例中,我有一条访问bikespage -component(位于.../pages/pages/bike/bikespage 中)的路线。 >)。

为了提出您的问题,要通过其绝对名称使它们可召唤,name必须与path相同。希望这对您或后来来这里的任何人都可以帮助您!

A late response to your question, but all the routes are managed in the Routes.tsx-file. In my example, I have a route to access the BikesPage-component (located in .../pages/Bike/BikesPage hence the naming BikeBikesPage).

RedwoodJS routes file

So to ask your question, to make them callable by their absolute name, the name must be the same as the path. Hope that helped you or anyone coming here afterwards!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文