All functions listed below are exported directly by one
.
A function that takes two arguments: a string path
, and a number status
.
It accepts relative paths by using the getURL
helper internally.
On the server (including in loaders) it returns a Response.redirect
object. On the client it calls router.navigate
and returns void.
A function that takes no arguments and returns a string of the current URL of the running application on client or server.
For example, in dev-mode by default this would be a string of http://127.0.0.1:8081
. In non-development environments you will need to set process.env.ONE_SERVER_URL
to your production URL with no trailing /
.
One uses Request
/Response
type objects for API routes, but for some environments doing an instanceof Response
can fail, isResponse
takes any value and returns true if it is a Response-like object. Useful for API utility functions.
Edit this page on GitHub.