Set up a hot reload framework for running the front end.

This commit is contained in:
Drew Galbraith 2024-07-05 21:31:48 -07:00
parent 13e07e42df
commit 637a246caa
4 changed files with 38 additions and 0 deletions

1
.gitignore vendored
View File

@ -3,4 +3,5 @@ target/
.env .env
*.db *.db
frontend/build
frontend/elm-stuff frontend/elm-stuff

14
frontend/Caddyfile Normal file
View File

@ -0,0 +1,14 @@
{
auto_https off
}
http://localhost:8000
handle_errors {
rewrite * /index.html
file_server
}
file_server

10
frontend/elm-watch.json Normal file
View File

@ -0,0 +1,10 @@
{
"targets": {
"Captain's Log": {
"inputs": [
"src/Main.elm"
],
"output": "build/main.js"
}
}
}

13
frontend/index.html Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>Captains Log</title>
<script type="text/javascript" src="/build/main.js"></script>
</head>
<body>
<script>
var app = Elm.Main.init();
</script>
</body>
</html>