Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
remix-mount-routes
Advanced tools
This package enables you to mount your Remix app at a different path than root.
> npm install -D remix-mount-routes
Update your remix.config.js file and use the custom routes config option.
Call mountRoutes(basePath, routesDir, ignoredRouteFiles?)
and return
the route manifest.
NOTE: basePath
should be an absolute path (e.g., /myapp
)
Your route files are still relative to app/routes
folder. That is
app/routes/posts/$slug.tsx
will map to the URL /myapp/posts/:slug
Depending on your setup, you may also need to update publicPath
and
assetsBuildDirectory
to include your basePath
. This will ensure that your
assets will be served properly.
You can either hard-code the basePath in your config file, or use an environment variable like:
"build": "cross-env REMIX_BASEPATH=/myapp remix build",
"dev": "cross-env REMIX_BASEPATH=/myapp remix dev",
// remix.config.js
const { mountRoutes } = require('remix-mountroutes')
const basePath = process.env.REMIX_BASEPATH ?? ''
module.exports = {
ignoredRouteFiles: ['.*'],
publicPath: `${basePath}/build/`,
assetsBuildDirectory: `public${basePath}/build`,
routes: defineRoutes => mountRoutes('app', basePath, defineRoutes),
}
Here's a repo with a sample app mounted to /myapp
https://github.com/kiliman/remix-mount-routes-example
And here's the running app
https://remix-mount-routes-example.herokuapp.com
Thanks goes to these wonderful people (emoji key):
Kiliman 💻 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!
v0.1.1
mountRoutes
signature to make it more flexibleFAQs
Package for mounting Remix routes to any path
The npm package remix-mount-routes receives a total of 127 weekly downloads. As such, remix-mount-routes popularity was classified as not popular.
We found that remix-mount-routes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.