forked from jwkwon-715/donimoney
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (30 loc) · 965 Bytes
/
Makefile
File metadata and controls
37 lines (30 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
SHELL := /bin/bash
NPM ?= npm
.PHONY: check-npm ci test lint route-check
check-npm:
@command -v $(NPM) >/dev/null 2>&1 || { \
echo "[ERROR] '$(NPM)' not found in PATH."; exit 127; }
#라우트 검사(퍼블릭)
ROUTES_PUBLIC = / /users /game /quiz /curriculum /stories
route-check:
@echo "==== Route health check ===="
@for path in $(ROUTES_PUBLIC); do \
echo "→ Checking http://localhost:3000$$path"; \
status=$$(curl -o /dev/null -s -w "%{http_code}" "http://localhost:3000$$path"); \
if [ "$$status" -ge 200 ] && [ "$$status" -lt 400 ]; then \
echo " [OK] $$path (status $$status)"; \
else \
echo " [FAIL] $$path (status $$status)"; \
exit 1; \
fi; \
done
@echo "==== All public routes OK ===="
ci: check-npm lint test route-check
@echo "==== CI process completed ===="
test: check-npm
@echo "==== Running Node.js tests... ===="
$(NPM) ci
$(NPM) test
lint: check-npm
@echo "==== ESLint ===="
npx eslint .