Skip to content

Commit

Permalink
Rename defaultHost.ts file & fix a wrong spelling
Browse files Browse the repository at this point in the history
Rename `src/defaultHost.ts` to `src/constant.ts`
and fix the wrong spelling `defaulPort` typo by
just ranaming it to `defaultPort`.
  • Loading branch information
AbdulrhmanGoni committed Jan 28, 2025
1 parent c1af00e commit 3dcbd0b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type {
ShowResponse,
StatusResponse,
} from './interfaces.js'
import { defaultHost } from './defaultHost.js'
import { defaultHost } from './constant.js'

export class Ollama {
protected readonly config: Config
Expand Down
2 changes: 2 additions & 0 deletions src/constant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const defaultPort = '11434';
export const defaultHost = `http://127.0.0.1:${defaultPort}`;
2 changes: 0 additions & 2 deletions src/defaultHost.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { version } from './version.js'
import type { ErrorResponse, Fetch } from './interfaces.js'
import { defaulPort, defaultHost } from './defaultHost.js'
import { defaultPort, defaultHost } from './constant.js'

/**
* An error class for response errors.
Expand Down Expand Up @@ -289,7 +289,7 @@ export const formatHost = (host: string): string => {
let port = url.port
if (!port) {
if (!isExplicitProtocol) {
port = defaulPort
port = defaultPort
} else {
// Assign default ports based on the protocol
port = url.protocol === 'https:' ? '443' : '80'
Expand Down

0 comments on commit 3dcbd0b

Please sign in to comment.