Skip to content

Commit

Permalink
Merge pull request #2 from eosnetworkfoundation/zach-caddy
Browse files Browse the repository at this point in the history
Local Caddy Server
  • Loading branch information
kj4ezj authored Jul 6, 2024
2 parents a751d9f + 6a0461d commit adb292d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
9 changes: 9 additions & 0 deletions caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:8443 {
root * ./build
file_server
encode gzip

tls internal {
on_demand
}
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"dev": "vite dev",
"preview": "vite preview",
"serve": "./serve.sh"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
Expand Down
12 changes: 12 additions & 0 deletions serve.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -eo pipefail
function ee {
printf "\e[2m$ %s\e[0m\n" "$*"
eval "$@"
}

echo 'Starting local Caddy web server.'
echo -e '\e[1;35mURL: https://localhost:8443\e[0m'
echo -e '\e[1;93mPress [Ctrl] + C to exit...\e[0m'

ee "docker run -v \"\$(git rev-parse --show-toplevel):/http\" -w '/http' -p '8443:8443' caddy caddy run --config caddyfile"

0 comments on commit adb292d

Please sign in to comment.