Reputation: 174
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.
Upvotes: 1
Views: 1764
Reputation: 21
problem probably is, that in /publix/index.html
link to the explorer has not changed, and it points to /explorer
. After changing base path you should change this link to {your new base path}/explorer
. Changing the base path in the app does not update static resources. Basically, in index.html
you should have:
<h3>API Explorer: <a href="/api/v1/explorer">/explorer</a></h3>
then it will work
Upvotes: 2