mirror of
https://github.com/pa11y/pa11y-dashboard.git
synced 2025-09-24 22:31:15 +00:00
Reorder the routes to avoid MongoDB ObjectID error
When trying to add a new URL, the Node.js MongoDB driver complains with the following error: ``` ObjectID generation failed. Argument passed in must be a single String of 12 bytes or a string of 24 hex characters ``` This is because the `/new` url gets captured by the `/:id` route defined in `/route/task/index.js`. It's another instance of #244 that I missed when fixing it.
This commit is contained in:
3
app.js
3
app.js
@@ -92,7 +92,6 @@ function initApp(config, callback) {
|
||||
|
||||
// Load routes
|
||||
require('./route/index')(app);
|
||||
require('./route/task/index')(app);
|
||||
require('./route/result/download')(app);
|
||||
if (!config.readonly) {
|
||||
require('./route/new')(app);
|
||||
@@ -102,6 +101,8 @@ function initApp(config, callback) {
|
||||
require('./route/task/ignore')(app);
|
||||
require('./route/task/unignore')(app);
|
||||
}
|
||||
// Needs to be loaded after `/route/new`
|
||||
require('./route/task/index')(app);
|
||||
// Needs to be loaded after `/route/task/edit`
|
||||
require('./route/result/index')(app);
|
||||
|
||||
|
Reference in New Issue
Block a user