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

feat: add host and port support to TuonoConfig #366

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Valerioageno
Copy link
Member

@Valerioageno Valerioageno commented Jan 17, 2025

In the first commit I added the support for the new object

const config: TuonoConfig = {
   server: {
       host: 'localhost',
       port: 3000
   }
}

I messed up a bit the files because in the same commit I split loadConfig and normalizeConfig in two different files to better manage the test files.

Note

In my opinion utils.ts should be used for silly reusable functions - not core functionalities

The only test that has been added is:

// config/normalize-config.spec.ts
describe('server', () => {
    it('should assign the host and port defined by the user', () => {
      const config: TuonoConfig = {
        server: { host: '0.0.0.0', port: 8080 },
      }

      expect(normalizeConfig(config)).toStrictEqual(
        expect.objectContaining({
          server: expect.objectContaining({
            host: '0.0.0.0',
            port: 8080,
          }) as unknown,
        }),
      )
    })
  })

@github-actions github-actions bot added the typescript Requires typescript knowledge label Jan 17, 2025
@Valerioageno Valerioageno self-assigned this Jan 17, 2025
@marcalexiei marcalexiei linked an issue Jan 18, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Requires typescript knowledge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Add custom address:port binding
2 participants