feat(server): add config option for server port

dev
Jef Roosens 2022-06-15 12:10:58 +02:00 committed by Jef Roosens
parent 9727b86203
commit fcdcf9c5ca
Signed by untrusted user: Jef Roosens
GPG Key ID: B580B976584B5F30
4 changed files with 10 additions and 3 deletions

View File

@ -7,9 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://git.rustybever.be/vieter/vieter/src/branch/dev) ## [Unreleased](https://git.rustybever.be/vieter/vieter/src/branch/dev)
### Added
* Server port can now be configured
### Changed ### Changed
* Moved all API routes under `/v1` namespace * Moved all API routes under `/v1` namespace
* Renamed `vieter repos` to `vieter targets`
* Renamed `/v1/api/repos` namespace to `/v1/api/targets`
## [0.3.0](https://git.rustybever.be/vieter/vieter/src/tag/0.3.0) ## [0.3.0](https://git.rustybever.be/vieter/vieter/src/tag/0.3.0)

View File

@ -45,7 +45,8 @@ configuration variable required for each command.
This prevents the server from being confused when an `any` package is This prevents the server from being confused when an `any` package is
published as the very first package for a repository. published as the very first package for a repository.
* Git repositories added without an `arch` value use this value instead. * Git repositories added without an `arch` value use this value instead.
* `port`: HTTP port to run on
* Default: `8000`
### `vieter cron` ### `vieter cron`

View File

@ -10,6 +10,7 @@ pub:
data_dir string data_dir string
api_key string api_key string
default_arch string default_arch string
port int = 8000
} }
// cmd returns the cli submodule that handles starting the server // cmd returns the cli submodule that handles starting the server

View File

@ -8,7 +8,6 @@ import util
import db import db
const ( const (
port = 8000
log_file_name = 'vieter.log' log_file_name = 'vieter.log'
repo_dir_name = 'repos' repo_dir_name = 'repos'
db_file_name = 'vieter.sqlite' db_file_name = 'vieter.sqlite'
@ -77,5 +76,5 @@ pub fn server(conf Config) ? {
conf: conf conf: conf
repo: repo repo: repo
db: db db: db
}, server.port) }, conf.port)
} }