I think we're talking at cross-purposes here.
You don't need to be running plackup in order to use Plack middleware. You just need to be running a PSGI app - which you are, it's in your app.psgi.
Assuming that you're using the app,psgi that dancer2 originally generated for you, then it will look something like this:
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use MyWebApp;
MyWebApp->to_app;
(Obviously substituting the name of your app for "MyWebApp".)
To add Plack::Middleware::Static, you would change it to look something like this:
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use Plack::Builder;
use MyWebApp;
builder {
enable 'Plack::Middleware::Static',
path => qr{^/(javascripts|css)/} , root => './public/';
MyWebApp->to_app;
};
To (attempt to) be completely clear - you can use Plack middleware with any PSGI app. You don't need to be running it under plackup. Running it under Starman (or any other PSGI server) will work just as well.
Hope that's clearer.
Dave...