Fork me on GitHub
#clojurescript
<
2024-01-03
>
vraid23:01:30

Okay, i've gotten to shadow-cljs release app. Now what? All the documentation i find seems to assume that you already know how to proceed, and not knowing the js ecosystem makes this somewhat hard to search for

Sam Ferrell23:01:55

What are you trying to do? You compiled your app with shadow-cljs release app? There should be a single JS file somewhere now that you can include in your HTML

1
vraid00:01:53

Right, that did it! Now what's the go-to way of serving these files to the web from my local machine?

Nundrum00:01:02

Long term? Apache HTTPD or NGINX or something like that. Depending on your needs.

Omer ZAK00:01:35

@U0552GV2X32 If you want to let your friends browse those files while they are hosted by your computer, you can use https://ngrok.io

🤯 1
Nundrum00:01:52

You pretty much drop the html, css, images, and app.js into a folder and let the server serve them up.

Sam Ferrell00:01:18

npx http-server is a quick way to boot up a file server from whichever directory its run in

Sam Ferrell00:01:50

Ehh but yeah that won't be accessible publicly on the web, only your machine

1
vraid01:01:42

Apache rang a bell, and i got it up and running. Thanks for pointing me in the right direction 🙂

👍 1
Chris McCormick05:01:20

@U0552GV2X32 i recommend https://piku.github.io for deploying simple static sites on your own VPS.

elken07:01:16

Or just use github pages, netlify, vercel, etc. No server needed here.

👍 1
vraid14:01:57

I don't have a VPS at the moment, but github pages might actually be something for pure client-side projects

elken14:01:36

Isn't that what you have here? A bunch of static content?

vraid14:01:30

That's what i meant to imply, it would work for this use case

2
vraid13:01:49

Returning to this topic, would i commit the compiled javascript to the git repository alongside the clojurescript if using github pages? (haven't used github pages before, nor made a website really)

elken13:01:24

You can if you want, but you'd probably be better served having a github action take care of the compiling and deployment. https://github.com/marketplace/actions/deploy-to-github-pages If you want a more copy-able example, https://github.com/elken/aoc/blob/master/.github/workflows/deploy.yml (you can remove the steps that aren't needed here like setting up java etc)

vraid13:01:17

That seems much more reasonable yes

vraid14:01:28

..which steps are needed? 😅

elken14:01:28

They're well-named 😄 probably just the first and last with an extra step to install node & run npx shadow-cljs release app

vraid14:01:59

I'm sure they're well named to someone who knows what the heck they're doing ^^

vraid14:01:39

clerk & yarn tell me nothing. Cache, sure, but what does it do in this context? And are the DeLaGuardo and JamesIves links generic scripts or something repo-specific?

elken14:01:03

As I said, probably just the first and last 🙂

vraid14:01:41

All right thanks, i'll have a go at it later tonight 🙂

vraid15:01:45

Is this key > ssh-key: ${{ secrets.SSH_KEY }} < supplied by the git push?

elken15:01:16

Not needed for you 🙂

vraid15:01:29

I thought that was the first step? Now i'm getting lost again 😅

elken15:01:53

The line is not needed for you