Overview
Emtrey can automatically detect all of your application’s routes by parsing router files, but in case you want granular control over the URLs Emtrey analyzes, you can customize the URLs by using a configuration file.
If you don’t already have an emtrey.config.js
file in your project we will create one. If you already have one you may skip Step 1.
Step 1: Create an Emtrey Configuration File
Create a new file in the route of your project named emtrey.config.js
module.exports = {}
Be sure to commit this file to track changes in git.
Step 2: Manually Adding Routes
In your Emtrey configuration file, add a property to the exported object name visitRoutes, this should be an array of strings that you’d like Emtrey to visit on each run. Here is an example file with routes in place:
module.exports = {
visitRoutes: ['/', '/contact', '/about?member=bob', '/projects',
'projects/4', '/clients', '/clients/10/details']
}
That’s it! You’re now ready to run Emtrey again via npx emtrey and you should now only see results from the routes you just configured.