mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-08-23 22:28:43 +08:00
Serve both UI assets and REST API from handler
This commit is contained in:
19
Makefile
19
Makefile
@@ -1,22 +1,9 @@
|
||||
.PHONY: assets sync go_binary build docker
|
||||
.PHONY: build docker
|
||||
|
||||
NODE_PATH ?= $(PWD)/ui/node_modules
|
||||
|
||||
assets:
|
||||
@if [ ! -d "$(NODE_PATH)" ]; then cd ./ui && yarn install --modules-folder $(NODE_PATH); fi
|
||||
cd ./ui && yarn build --modules-folder $(NODE_PATH)
|
||||
|
||||
# sync will copy the ui build assets to cmd/asynqmon so that it can be embedded into the go binary
|
||||
sync:
|
||||
rsync -avu --delete "./ui/build/" "./cmd/asynqmon/ui-assets"
|
||||
|
||||
# Build go binary.
|
||||
go_binary: assets sync
|
||||
# Build a release binary.
|
||||
build:
|
||||
go build -o asynqmon ./cmd/asynqmon
|
||||
|
||||
# Target to build a release binary.
|
||||
build: go_binary
|
||||
|
||||
# Build image and run Asynqmon server (with default settings).
|
||||
docker:
|
||||
docker build -t asynqmon .
|
||||
|
Reference in New Issue
Block a user