dnote/web/scripts/dev.sh
Sung Won Cho 478b412169
Display version in settings (#293)
* Display version in settings

* Fix placeholder

* Fix button size

* Fix time format

* Add support link

* Add license
2019-10-30 00:58:08 -07:00

41 lines
943 B
Bash
Executable file

#!/usr/bin/env bash
# shellcheck disable=SC1090
# dev.sh builds and starts development environment
set -eux -o pipefail
# clean up background processes
function cleanup {
kill "$devServerPID"
}
trap cleanup EXIT
basePath="$GOPATH/src/github.com/dnote/dnote"
appPath="$basePath/web"
serverPath="$basePath/pkg/server"
serverPort=3000
# load env
set -a
dotenvPath="$serverPath/.env.dev"
source "$dotenvPath"
set +a
# run webpack-dev-server for js in the background
(
cd "$appPath" &&
BUNDLE_BASE_URL=http://localhost:8080 \
ASSET_BASE_URL=http://localhost:3000/static \
ROOT_URL=http://localhost:$serverPort \
COMPILED_PATH="$appPath"/compiled \
PUBLIC_PATH="$appPath"/public \
COMPILED_PATH="$basePath/web/compiled" \
IS_TEST=true \
VERSION="$VERSION" \
"$appPath"/scripts/webpack-dev.sh
) &
devServerPID=$!
# run server
(cd "$serverPath" && CompileDaemon \
-command="$serverPath/server start -port $serverPort")