In the root directory:
npm create vite@latest
and the project is named frontend
.
npm install
npm run dev
and the project is served at http://localhost:5173/
-
Added
sbt
configuration. -
Added
Main.scala
for code in scala.js -
Run
~fastLinkJS
insbt
andnpm run dev
on another terminal
-
Added
laminar
as a dependency -
Changed
Main.scala
to use laminar- It seems that something needs a
@main
entrypoint because leaving the code at top-level does not compile.
- It seems that something needs a
-
Added configuration in
build.sbt
-
Minimal "test" on browser console (in many tabs) by:
let ws = new WebSocket('ws://localhost:8080/subscribe')
ws.onmessage = function(e) { console.log(e) }
ws.send("potato")
-
Added dependency on 'laminext'
-
Added proxy in `vite.config.js' for the websocket endpoint on the server
-
To run in development mode
- on
sbt
runbackend/run
- on
sbt
runfrontend/fastLinkJS
- in
frontend
foldernpm run dev
- on
-
Added the plug-in to sbt configuration
-
Now to start the
backend
:-
on
sbt
runbackend/reStart
(or~backend/reStart
to trigger restarting the app with changes) -
you also have
reStop
andreStatus
-
-
on
sbt
runfrontend/fullLinkJS
-
copy
frontend/index.html
andfrontend/target/scala-3.4.0/frontend-opt/main.js
andfrontend/public/*
tobackend/src/main/resources/public
-
change the
public/index.html
to point to themain.js
in thepublic
folder -
on
sbt
runbackend/reStart
-
open
http://localhost:8080
-
on
sbt
runbackend/assembly
and theuberjar
file is atbackend/target/scala-3.4.0/code-to-screen-standalone.jar
-
you can run in by
java -jar code-to-screen-standalone.jar
-
run
docker build -t code-to-screen-scala .
to build an image -
docker run --detach --publish 8080:8080 --name code-to-screen-1 code-to-screen-scala
-
added
fly.toml
file -
run
fly auth login
and thenfly deploy