-
Notifications
You must be signed in to change notification settings - Fork 251
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
refactor: put the default host in a variable and then reuse it #197
refactor: put the default host in a variable and then reuse it #197
Conversation
@AbdulrhmanGoni tests are failing because of package version mismatch. |
src/defaultHost.ts
Outdated
export const defaulPort = '11434'; | ||
export const defaultHost = `http://127.0.0.1:${defaulPort}`; |
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.
better you can give generic name constant.js
that store all the constant here of defaultHost.js
There is wrong spelling too.
export const defaulPort = '11434'; | |
export const defaultHost = `http://127.0.0.1:${defaulPort}`; | |
export const port = '11434'; | |
export const host = `http://127.0.0.1:${port}`; |
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.
better you can give generic name
constant.js
that store all the constant here ofdefaultHost.js
OK, I renamed defaultHost.ts
file to constant.ts
And i fixed the wrong spelling, But i think there is no need to rename the variables defaultHost
and defaultPort
to host
and port
because there are already variables with these names
in src/utils.ts
file (one of the places where defaultHost
and defaultPort
are used in)
The default host 'http://127.0.0.1:11434' is hardcoded in multiple places, So, Put it in one variable in a central place (`src/defaultHost.ts` file) and reuse it in those places.
Rename `src/defaultHost.ts` to `src/constant.ts` and fix the wrong spelling `defaulPort` typo by just ranaming it to `defaultPort`.
2c52e68
to
3dcbd0b
Compare
I understood package version mismatch causes the tests to fail, |
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.
Thanks for fixing the build errors too.
Merging this one for now, fixing the build errors in a fast follow. |
The default host
http://127.0.0.1:11434
is hard-coded in multiple places,So, Put it in one variable in a central place (
src/defaultHost.ts
file) and then reuse it in those places.