diff options
-rw-r--r-- | META6.json | 1 | ||||
-rw-r--r-- | config.toml | 6 | ||||
-rw-r--r-- | vlc.raku | 13 |
3 files changed, 18 insertions, 2 deletions
@@ -2,6 +2,7 @@ "perl": "6.d", "name": "Vlc::Control", "depends": [ + "Config::TOML", "Cro::BodyParser", "Cro::HTTP::Client", "Cro::HTTP::Message", diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..cc23482 --- /dev/null +++ b/config.toml @@ -0,0 +1,6 @@ +[vlc] +password = "ginopino" +base-uri = "http://127.0.0.1:8080/requests/" + +[server] +port = 8090 @@ -1,12 +1,21 @@ #!/usr/bin/env rakudo use v6.d; use lib 'inst#local','file#lib'; +use Config::TOML; use Vlc::Client; use Vlc::App; -my Vlc::Client $vlc .= new(:password<ginopino>,:base-uri<http://192.168.1.111:8080/requests/>); +my $config = from-toml(file=>'config.toml'); -my Vlc::App $app .= new(:port(8080), :$vlc); +my Vlc::Client $vlc .= new( + password => $config<vlc><password>, + base-uri => $config<vlc><base-uri>, +); + +my Vlc::App $app .= new( + port => $config<server><port>, + :$vlc, +); $app.start; |