0

I created a small application in clojure using luminus framework. When I run the app using lein run everything works well. It loads css and js properly but when I create a war file and deploy on google app engine, stylesheets don't work. I tried the solution given on this link: Serving static files with ring/compojure - from a war but it is still not working. May be there is something specific to luminus which I am missing. When I inspect it and look at console it shows this error

GET unbound: net::ERR_UNKNOWN_URL_SCHEME"

I think I am missing something in luminus Can someone help please. Thanks

Community
  • 1
  • 1
divya nagar
  • 33
  • 1
  • 6
  • Something is misconfigured and the string 'unbound' is being set as the target of some ``. Can you post more information about how you're set up? – Alejandro C. Nov 17 '16 at 22:28
  • Do you use Selmer? Could you, please, publish the source of the page? – r00tt Nov 18 '16 at 00:05
  • Yes I am using Selmer, Basically it is talking adding servlet-context in the path when I run it con GAE. So path is coming as '' – divya nagar Nov 18 '16 at 09:17
  • I think I figured it out. According to this documentation [link] (http://www.luminusweb.net/docs/html_templating.md) Selmer will prepend the servlet-context automatically until it is not present. So instead of using Selmer style we can use link tag `` directly to get the files. But is there any way to use Selmer style tag without prepending servlet-context? – divya nagar Nov 18 '16 at 09:52

1 Answers1

0

So I figured out why this is happening. The Selmer style tag {% style "filename" %} will generate an HTML script tag and prepend the value of the servlet-context key to the URI. When servlet-context key is not present then the original URI is set. So when you give src = "css/filename" it gives the src = servlet-context + "css/filename" which can be seen in inspect. So to avoid it either do not associate servlet-context or use normal stylesheet <link> to add your static css/js files. To remove servlet-context Just comment out :servlet-context *app-context* line form render function in layout.clj file and it will start working.

divya nagar
  • 33
  • 1
  • 6