1

I want to set basepath to my application. I updated with

await app.restServer.basePath('/api/v1');   

in my "index.js" at my project root folder. But when I'm trying to access the explorer, throwing errors as "Cant get explorer".

    await app.basePath('/api/v1'); 
       await app.restServer.basePath('/api/v1');
     this.static('/', path.join(__dirname, '../public'));
this.bind(RestBindings.SequenceActions.SEND).toProvider(Validateprovider);
        this.bind(RestExplorerBindings.CONFIG).to({
          path: path.resolve('/explorer'),
        });

Once the application is loaded, am able to access this URL: http://127.0.0.1:8020/api/v1 But when I click on explorer in the same page. Its not redirecting to explorer, instead giving error as

" Cannot GET /explorer/"

Please let me know how to access explorer with the prefix which I have mentioned.

4

2 に答える 2

1

これは application.ts で行う必要があります。

this.bind(RestExplorerBindings.CONFIG).to({
  path: '/api/v1',
});

詳細については、こちらのドキュメントを参照してください。

于 2019-05-28T10:15:50.160 に答える