Files
gotsrpc/example/auth/Makefile
Uwe Quitter 5d68c02535 feat: Add authentication example demonstrating gotsrpc Context function
This example showcases gotsrpc's special Context function for centralized
authentication. The Context function handles all authentication logic,
keeping service methods clean and focused on business logic.

Key principle: Centralized authentication via Context function
- Context function validates Authorization header once
- Service methods remain clean without auth boilerplate
- Single point of authentication for entire service

Example includes:
- AuthService: Login/logout operations
- HelloService: Demonstrates Context function pattern
- Complete build system with Makefile
- TypeScript client with proper ES6 modules
- Comprehensive tests and documentation

Files: example/auth/ (complete authentication example)
2025-10-22 16:07:17 +02:00

26 lines
497 B
Makefile

.PHONY: build-client run-server run clean
# Build the TypeScript client to dist directory
build-client:
cd client && npx tsc
# Run the server
run-server:
go run main.go
# Build client and run server
run: build-client run-server
# Generate gotsrpc code
generate:
rm -f client/src/*_gen.ts
rm -f service/*_gen.go
gotsrpc gotsrpc.yml
# Clean compiled JavaScript files
clean:
rm -rf client/dist/*.js
# Full build: generate + build client + run server
dev: generate build-client run-server