Fork me on GitHub
#shadow-cljs
<
2023-01-16
>
fabrao01:01:33

Hello, when I configure

:dev-http
 {8280 "resources/public"}
I have to use http://localhost:8280. Is there any way to configure the response with http://localhost:8280/somethig ?

thheller07:01:59

what would it respond with? I mean it'll respond with the index.html contents by default?

fabrao10:01:58

Hello, I'd like to use something like http:://localhost:8280/app because I have all the time changing my index.html for local dev to <base href="/"> and for production <base href="/app/">

thheller12:01:07

sorry I really do not understand what you are asking?

thheller12:01:20

just create a resource/public/app/index.html if you want other html?

thheller12:01:43

or use your own server?

fabrao12:01:34

I want to use shadow-cljs server but with different base path like http://localhost:8280/app and not http://localhost:8280/

thheller13:01:42

and I don't understand what the problem is? like what is not working now? what is stopping you from opening this url?

fabrao13:01:27

I don't have problem, I just wondering if I could configure shadow-cljs like that.

thheller14:01:03

configure what?

fabrao14:01:38

to shadow-cljs serve with this path -> http://localhost:8280/app

thheller14:01:41

I'm still completely lost and do not understand your question? the config you have above is fine. Just open http://localhost:8280/app? I don't get it

thheller14:01:50

IT ALREADY DOES!

thheller14:01:27

or what am I missing here?

fabrao14:01:56

oh, now I understand what you mean, but I don't want to create the resource/public/app folder

thheller14:01:04

ok, I'm entirely lost. open http://localhost:8280/app with the config above. what do you get? what else do you expect?

fabrao14:01:06

like this

:dev-http
 {8280 {:root "resources/public" :path "/app"}}

thheller14:01:25

that doesn't help me understand what problem you are trying to solve here

thheller14:01:46

I do not understand the question, so please help me understand what is currently not working

fabrao14:01:03

:rolling_on_the_floor_laughing:, sorry about that

thheller14:01:03

YOU control the URL you open in the browser. so just open http://localhost:8280/app and be done with it? what is the thing I'm missing here?

fabrao14:01:09

Sorry about my "miss" explaining. In production enviroment is in reverse proxy with this this path . So, I have to use in index.html <base href="/app/"> to all the links works. Ok until now?

thheller14:01:46

so you are not actually asking about index.html. you are asking about additional assets like the .js files or images?

thheller14:01:12

or what does "all the links works" mean?

fabrao14:01:14

but when I'm in local enviroment, I have to use index.html <base href="/">, to use with this config :dev-http {8280 "resource/public"}.

thheller14:01:45

so you are asking about assets. not the html?

fabrao14:01:19

link work with <link rel="stylesheet" href="css/default.css" />

thheller14:01:05

ok now we are getting somewhere. no this is not supported

thheller14:01:25

I thought you were asking about the html only, and didn't understand the problem.

fabrao14:01:00

no, with all assets. If shadow-cljs could serve the files with any path, I don't have to change the <base href="/app">

thheller14:01:10

but it should be fine if you just create a symlink in resources/public

thheller14:01:31

so just ln -s resources/public/app resources/public?

fabrao14:01:06

I can try to see if it will work

fabrao14:01:29

many sorry taking your time like that, thank you

fabrao14:01:19

didn't work

thheller14:01:27

how are you deploying to production?

fabrao14:01:14

only change it to <base href="/app/"> and it works

thheller14:01:21

not what I asked

thheller14:01:37

how do you actually deploy. do you build an uberjar? do you copy files?

fabrao14:01:48

copy the files

thheller14:01:01

so why don't you just copy the files to the proper location?

fabrao14:01:29

yes, I'll do it