aboutsummaryrefslogtreecommitdiff
path: root/bin/dev-server
blob: cb124df39b460c6e5a6eeba013f28a8dfbb9bf1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
set -euo pipefail

if ! [ -f db.sqlite3 ]; then

  echo "Creating database"
  sqlite3 db.sqlite3 < init-db.sql
  sleep 1

fi

export HOST="127.0.0.1"
export PORT="8080"
export KEY="1234"
export DB="db.sqlite3"
export FILES_DIR="files"

watchexec \
    --clear \
    --restart \
    -w src \
    "RUST_LOG=info cargo run"