summary refs log tree commit diff stats
path: root/server
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2022-02-02 12:34:38 +0530
committerAndinus <andinus@nand.sh>2022-02-02 13:03:34 +0530
commit8234345a00d14fee2b5ca18466f19d2df4b4a5c7 (patch)
tree772fc64f448c000df6ae6bea5387b469c82fa75f /server
downloadvela-8234345a00d14fee2b5ca18466f19d2df4b4a5c7.tar.gz
Initial commit
- Initialize the project with PrimeVue for UI.
Diffstat (limited to 'server')
-rw-r--r--server/.gitignore5
-rw-r--r--server/service.raku33
2 files changed, 38 insertions, 0 deletions
diff --git a/server/.gitignore b/server/.gitignore
new file mode 100644
index 0000000..35e5575
--- /dev/null
+++ b/server/.gitignore
@@ -0,0 +1,5 @@
+# Caches
+.precomp
+
+# Backup files
+*~
diff --git a/server/service.raku b/server/service.raku
new file mode 100644
index 0000000..2a41f5b
--- /dev/null
+++ b/server/service.raku
@@ -0,0 +1,33 @@
+use Cro::HTTP::Server;
+use Cro::HTTP::Router;
+use Cro::HTTP::Log::File;
+
+unit sub MAIN(
+    Bool :$debug = True, #= enable debug mode
+);
+
+my $application = route {
+};
+
+my $host = 0.0.0.0;
+my $port = 9090;
+
+my Cro::Service $http = Cro::HTTP::Server.new(
+    http => <1.1>,
+    host => $host,
+    port => $port,
+    :$application,
+    after => [
+              Cro::HTTP::Log::File.new(logs => $*OUT, errors => $*ERR)
+          ]
+);
+$http.start;
+put "Listening at http://{$host}:{$port}";
+
+react {
+    whenever signal(SIGINT) {
+        say "Shutting down...";
+        $http.stop;
+        done;
+    }
+}