-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(js client): improve things (one axios client, keepAlive, baseUrl… #47
feat(js client): improve things (one axios client, keepAlive, baseUrl… #47
Conversation
constructor(nettuAccount: string, token?: string) { | ||
this.nettuAccount = nettuAccount | ||
this.token = token | ||
export const createAxiosInstanceFrontend = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you document? What's the difference between this and createAxiosInstanceBackend
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated 👍
The main difference is that one allow keepAlive
, which needs the function to be async
as it needs to import a Node package.
Technically, it could be only one function, but I think it makes it easier for the frontend to still have a function that isn't async. That way, it can be defined directly as a variable in a file (export ....
) on the frontend
/** | ||
* Nettu account id (admin) | ||
*/ | ||
nettuAccount?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nettu or Nettei?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the moment nettu
is still used everywhere
I think I'll just make one big PR renaming everything to nittei
Changed
baseUrl
can be provided in the parameter of the function creating a new ClientkeepAlive
connections