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

Allow setting of the port number when using the --serve flag #1555

Closed
Tracked by #1528
hogo6002 opened this issue Jan 31, 2025 · 4 comments
Closed
Tracked by #1528

Allow setting of the port number when using the --serve flag #1555

hogo6002 opened this issue Jan 31, 2025 · 4 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@hogo6002
Copy link
Contributor

The port is currently hardcoded to 8000:

@Riddhimaan-Senapati
Copy link
Contributor

I would like to take this issue.

Riddhimaan-Senapati added a commit to Riddhimaan-Senapati/osv-scanner that referenced this issue Jan 31, 2025
1.Added a global variable servePort with a default value of "8000"

2.Added a new CLI flag --port that allows users to customize the port number used when serving the HTML report

3. Removed the hardcoded port number from the ServeHTML function, using the global servePort variable instead

4. The flag's Action function updates the global servePort variable when a custom port is specified

These changes allow users to specify a custom port using the --port flag when using the --serve option, while maintaining the default port 8000 if no custom port is specified.
Riddhimaan-Senapati added a commit to Riddhimaan-Senapati/osv-scanner that referenced this issue Jan 31, 2025
@Riddhimaan-Senapati
Copy link
Contributor

created a PR for this.

@hogo6002
Copy link
Contributor Author

hogo6002 commented Feb 3, 2025

Thanks for contributing! I've assigned tasks to you and will be reviewing your PRs.

@hogo6002
Copy link
Contributor Author

hogo6002 commented Feb 3, 2025

resolved in #1557

@hogo6002 hogo6002 closed this as completed Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants