forked from vieter-v/vieter
Compare commits
No commits in common. "2a4f0654ea1fc242057dadcb5c23598e5e46cde4" and "3f442d7290025a9dce3166b79b226569bc679b80" have entirely different histories.
2a4f0654ea
...
3f442d7290
|
|
@ -10,7 +10,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
* Moved all API routes under `/v1` namespace
|
* Moved all API routes under `/v1` namespace
|
||||||
* Server port can now be configured
|
|
||||||
|
|
||||||
## [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)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
// Bindings for the libarchive library
|
// Bindings for the libarchive library
|
||||||
module package
|
|
||||||
|
|
||||||
#flag -larchive
|
#flag -larchive
|
||||||
|
|
||||||
|
|
@ -12,7 +12,7 @@ pub fn (c &Client) get_targets(filter TargetFilter) ?[]Target {
|
||||||
return data.data
|
return data.data
|
||||||
}
|
}
|
||||||
|
|
||||||
// get_all_targets retrieves *all* targets from the API using the default
|
// get_all_targets retrieves *all* targs from the API using the default
|
||||||
// limit.
|
// limit.
|
||||||
pub fn (c &Client) get_all_targets() ?[]Target {
|
pub fn (c &Client) get_all_targets() ?[]Target {
|
||||||
mut targets := []Target{}
|
mut targets := []Target{}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
module server
|
|
||||||
|
|
||||||
import io.util
|
|
||||||
import os
|
|
||||||
|
|
||||||
fn test_targets_api() ? {
|
|
||||||
// Create a database
|
|
||||||
|
|
||||||
// Start the server in a temporary directory
|
|
||||||
tmpdir := util.temp_dir()?
|
|
||||||
go server.server(
|
|
||||||
data_dir: tmpdir
|
|
||||||
pkg_dir: os.join_path_single(tmpdir, 'pkgs')
|
|
||||||
api_key: 't'
|
|
||||||
port: 9000
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
@ -10,7 +10,6 @@ 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
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ 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'
|
||||||
|
|
@ -76,5 +77,5 @@ pub fn server(conf Config) ? {
|
||||||
conf: conf
|
conf: conf
|
||||||
repo: repo
|
repo: repo
|
||||||
db: db
|
db: db
|
||||||
}, conf.port)
|
}, server.port)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue