hapi-swaggered
hapi-swaggered copied to clipboard
How to add header to request?
Is there any way to send also header with requests?
The only way i found to achieve this is to set a requestInterceptor in the swagger-ui init (in index.hbs of hapi-swaggered-ui) : Something like this in the SwaggerUIBundle(Object.assign({....
requestInterceptor: (req) => {
req.headers.Authorization = 'Bearer ' + localStorage.getItem('token');
return req;
},