@@ -1677,36 +1677,14 @@ export function setupAPIRoutes(app: express.Application, config: Config): void {
16771677 promiseWrapper ( handleV2PendingApproval )
16781678 ) ;
16791679
1680- // any other API v2 call
1681- app . use ( '/api/v2/user/*' , parseBody , prepareBitGo ( config ) , promiseWrapper ( handleV2UserREST ) ) ;
1682- app . use ( '/api/v2/:coin/*' , parseBody , prepareBitGo ( config ) , promiseWrapper ( handleV2CoinSpecificREST ) ) ;
1683-
1684- app . post (
1685- '/api/network/v1/enterprises/:enterpriseId/clients/connections' ,
1686- parseBody ,
1687- prepareBitGo ( config ) ,
1688- promiseWrapper ( handleNetworkV1EnterpriseClientConnections )
1689- ) ;
1690-
1691- // everything else should use the proxy handler
1692- if ( config . disableProxy !== true ) {
1693- app . use (
1694- '/api/:namespace/v[12]/enterprises/:enterpriseId/*' ,
1695- parseBody ,
1696- prepareBitGo ( config ) ,
1697- promiseWrapper ( handleProxyReq )
1698- ) ;
1699-
1700- app . use ( parseBody , prepareBitGo ( config ) , promiseWrapper ( handleProxyReq ) ) ;
1701- }
1702-
17031680 // lightning - create invoice
17041681 app . post (
17051682 '/api/v2/:coin/wallet/:id/lightning/invoice' ,
17061683 parseBody ,
17071684 prepareBitGo ( config ) ,
17081685 promiseWrapper ( handleCreateLightningInvoice )
17091686 ) ;
1687+
17101688 // lightning - get invoice
17111689 app . get (
17121690 '/api/v2/:coin/wallet/:id/lightning/invoice/:paymentHash' ,
@@ -1755,6 +1733,29 @@ export function setupAPIRoutes(app: express.Application, config: Config): void {
17551733
17561734 // lightning - backup
17571735 app . get ( '/api/v2/:coin/wallet/:id/lightning/backup' , prepareBitGo ( config ) , promiseWrapper ( handleGetChannelBackup ) ) ;
1736+
1737+ // any other API v2 call
1738+ app . use ( '/api/v2/user/*' , parseBody , prepareBitGo ( config ) , promiseWrapper ( handleV2UserREST ) ) ;
1739+ app . use ( '/api/v2/:coin/*' , parseBody , prepareBitGo ( config ) , promiseWrapper ( handleV2CoinSpecificREST ) ) ;
1740+
1741+ app . post (
1742+ '/api/network/v1/enterprises/:enterpriseId/clients/connections' ,
1743+ parseBody ,
1744+ prepareBitGo ( config ) ,
1745+ promiseWrapper ( handleNetworkV1EnterpriseClientConnections )
1746+ ) ;
1747+
1748+ // everything else should use the proxy handler
1749+ if ( config . disableProxy !== true ) {
1750+ app . use (
1751+ '/api/:namespace/v[12]/enterprises/:enterpriseId/*' ,
1752+ parseBody ,
1753+ prepareBitGo ( config ) ,
1754+ promiseWrapper ( handleProxyReq )
1755+ ) ;
1756+
1757+ app . use ( parseBody , prepareBitGo ( config ) , promiseWrapper ( handleProxyReq ) ) ;
1758+ }
17581759}
17591760
17601761export function setupSigningRoutes ( app : express . Application , config : Config ) : void {
0 commit comments