File: not-found.pl

package info (click to toggle)
libmojolicious-plugin-assetpack-perl 2.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,888 kB
  • sloc: perl: 1,503; javascript: 52; makefile: 8; sh: 2
file content (28 lines) | stat: -rw-r--r-- 692 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env perl
die "Run $0 from ./mojo-assetpack/ root" unless -d 't/assets';
use lib 'lib';
use Mojolicious::Lite;

plugin 'AssetPack' => {pipes => [qw(Css JavaScript)]};
app->asset->store->paths(['t/assets']);

app->asset->process('app.css' => 'css/c.css');
app->asset->process('app.js'  => 'js/not-found.js');

# Set up the mojo lite application and start it
get '/' => 'index';
app->start;

__DATA__
@@ index.html.ep
<html>
<head>
  <title>Test!</title>
  <link rel="stylesheet" href="/asset/fallback/app.css">
</head>
<body>
  <h1>Check the console for debug messages</h1>
  <p>And the background should be gray.</p>
  <script src="/asset/fallback/app.js"></script>
</body>
</html>