Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Mojolicious: Optional placeholder and template name

by trippledubs (Deacon)
on May 19, 2019 at 13:13 UTC ( #11100253=note: print w/replies, xml ) Need Help??

in reply to Mojolicious: Optional placeholder and template name

If you run your site under morbo, the debug output should have some information on why your template is not rendering. The default error page under morbo is also helpful.

When you reference a link in the final html that is rendered, it will be relative to public. So a link like src=/blah.js means search for it in the public directories of the app, by default /public.

Update: Fix link

Second Update: Static files are served in sequential order from the array  $app->static->paths.

Replies are listed 'Best First'.
Re^2: Mojolicious: Optional placeholder and template name
by frazap (Monk) on May 21, 2019 at 10:12 UTC

    Thanks for helping. I should be more specific:

    The template common_js.html.ep (in ./templates) that load the js files is
    <script src="monomapdata.js" type="text/javascript"></script> <script src="monomap.js" type="text/javascript"></script> <script src="utils.js" type="text/javascript"></script>
    This works when I call http:// .... :3000/libmap, but not with :3000/fr/libmap If I change the src values to
    <script src="../monomapdata.js" type="text/javascript"></script> <script src="../monomap.js" type="text/javascript"></script> <script src="../utils.js" type="text/javascript"></script>
    :3000/fr/libmap works. But is it the right way to do this ?


      Did you try
      <script src="/monomapdata.js" type="text/javascript"></script>
        Yes ... That works too...

        How come ? Why ?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11100253]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2020-10-31 05:24 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (286 votes). Check out past polls.