diff options
-rw-r--r-- | server/.gitignore | 2 | ||||
-rw-r--r-- | server/service.raku | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/server/.gitignore b/server/.gitignore index 35e5575..4f6d02f 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -3,3 +3,5 @@ # Backup files *~ + +dist diff --git a/server/service.raku b/server/service.raku index 2a41f5b..00d1c51 100644 --- a/server/service.raku +++ b/server/service.raku @@ -7,9 +7,25 @@ unit sub MAIN( ); my $application = route { + post -> 'new' { + request-body -> (:$name) { + + } + } + + # Serving static assets. + get -> 'js', *@path { static 'dist/js', @path; } + get -> 'css', *@path { static 'dist/css', @path; } + get -> 'img', *@path { static 'dist/img', @path; } + get -> 'fonts', *@path { static 'dist/fonts', @path; } + + # Serve the app on all paths, it'll handle the routing. + get -> *@path { + static 'dist/index.html'; + } }; -my $host = 0.0.0.0; +my $host = "0.0.0.0"; my $port = 9090; my Cro::Service $http = Cro::HTTP::Server.new( |