有没有办法可以例行忽略某些URL路径?
我们正在使用GO(Buffalo)为使用Svelte和Rootify的单页应用程序(SPA)提供API和静态资产。
但是,我想通过Roadify忽略某些路由(例如“/auth/登录”),而是转到GO/Buffalo服务器来处理这些请求。
是否有例行设置?
我看到 ignore 构建config ,但这似乎是要告诉常客在构建路由列表时忽略某些文件,而不是忽略某些URL路径。
(如果需要的话,我也许可以获取我们的/auth/login
作为XHR调用工作,然后根据响应实际手动重定向浏览器,但是它会更好/更简单只需直接允许浏览器直接转到/auth/login
。)
更新:显然是直接转到/auth/login/code
(例如新标签)做我想要的。它只是单击SPA中的一个链接,该链接被Readify拦截。因此,我的问题仍然存在,尽管有些变化:
有没有办法告诉常客不要拦截某些URL路径的链接,而是简单地让浏览器转到该URL(离开水疗中心)?
We're using Go (Buffalo) to serve up both an API and the static assets for a Single-Page Application (SPA) that uses Svelte and Routify.
However, I'd like to have certain routes (e.g. "/auth/login") be ignored by Routify and instead go to the Go / Buffalo server, for handling those requests.
Is there a Routify setting for that?
I see the ignore
build config, but that seems to be for telling Routify to ignore certain files when building the list of routes, not ignoring certain URL paths.
(If I have to, I might be able to get our /auth/login
call to work as an XHR call, then actually manually redirect the browser based on the response, but it would be nicer/simpler to simply allow the browser to go to /auth/login
directly.)
UPDATE: Apparently going to /auth/login
directly (e.g. in a new tab) does what I want. It's just clicking a link in the SPA that gets intercepted by Routify. So my question still stands, though slightly altered:
Is there a way to tell Routify not to intercept links to certain URL paths, but to simply let the browser go to that URL (leaving the SPA)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
链接标签上的
target
属性可以执行我的追求。寻找适当的文档!来源:
https://www.routify.dev/guide/guide/navigation
在我的情况下,我需要,我需要为此:
The
target
attribute on a link tag does what I was after. Hooray for finding the appropriate documentation!Source:
https://www.routify.dev/guide/navigation
So in my case, I needed to do this: