change the base url to below and you should be able to run the app via spark "php spark serve"
app.baseURL = 'http://task.localhost/'
If you want to use "Xampp" don't use the default location "htdocs", create a new virtual hosting and point that to the app public folder.
virtual host code :
<VirtualHost *:80>
ServerName task.localhost
DocumentRoot "d:\xampp\htdocs\task\public"
<Directory "d:\xampp\htdocs\task\public">
Require all granted
AllowOverride All
</Directory>
</VirtualHost>
restart xampp and you should be able to access "http://task.localhost"