@@ -25,8 +25,8 @@ router.get(`/${apiVersion}/projects/health`, (req, res) => {
25
25
26
26
// List of public routes
27
27
const publicRoutes = [
28
- ` /${ apiVersion } /projects/copilots/opportunities` ,
29
- ` /${ apiVersion } /projects/copilot/opportunity/:id( \\d+)` ,
28
+ new RegExp ( `^ /${ apiVersion } /projects/copilots/opportunities$` ) ,
29
+ new RegExp ( `^ /${ apiVersion } /projects/copilot/opportunity/\\d+$` ) ,
30
30
] ;
31
31
32
32
// All project service endpoints need authentication
@@ -35,7 +35,7 @@ const jwtAuth = require('tc-core-library-js').middleware.jwtAuthenticator;
35
35
router . all (
36
36
RegExp ( `\\/${ apiVersion } \\/(copilots|projects|timelines|orgConfig|customer-payments)(?!\\/health).*` ) ,
37
37
( req , res , next ) => {
38
- if ( publicRoutes . some ( route => req . path . match ( new RegExp ( `^ ${ route } $` ) ) ) ) {
38
+ if ( publicRoutes . some ( routeRegex => routeRegex . test ( req . path ) ) ) {
39
39
return next ( ) ;
40
40
}
41
41
// JWT authentication
@@ -404,16 +404,6 @@ router.route('/v5/projects/copilots/opportunities')
404
404
router . route ( '/v5/projects/copilot/opportunity/:id(\\d+)' )
405
405
. get ( require ( './copilotOpportunity/get' ) ) ;
406
406
407
- // Project copilot opportunity apply
408
- router . route ( '/v5/projects/copilots/opportunity/:id(\\d+)/apply' )
409
- . post ( require ( './copilotOpportunityApply/create' ) ) ;
410
- router . route ( '/v5/projects/copilots/opportunity/:id(\\d+)/applications' )
411
- . get ( require ( './copilotOpportunityApply/list' ) ) ;
412
-
413
- // Copilot opportunity assign
414
- router . route ( '/v5/projects/copilots/opportunity/:id(\\d+)/assign' )
415
- . post ( require ( './copilotOpportunity/assign' ) ) ;
416
-
417
407
// Project Estimation Items
418
408
router . route ( '/v5/projects/:projectId(\\d+)/estimations/:estimationId(\\d+)/items' )
419
409
. get ( require ( './projectEstimationItems/list' ) ) ;
0 commit comments