Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per endpoint defaults? #19

Open
dnmd opened this issue May 18, 2020 · 0 comments
Open

Per endpoint defaults? #19

dnmd opened this issue May 18, 2020 · 0 comments

Comments

@dnmd
Copy link

dnmd commented May 18, 2020

I was wondering whether it would be possible to set the defaults based on the endpoints that are called? Something like:

// Setup some defaults per endoint
superagent
  .set('my-default-header', 'my-default-value')
  .auth('myUsername', 'myPassword');

// Pseudo
if(url == '/admin') {
superagent
  // overwrite default username and password
  .auth('admin', 'someAdminPassword');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant