Init
This commit is contained in:
29
Makefile
Normal file
29
Makefile
Normal file
@ -0,0 +1,29 @@
|
||||
.PHONY: start clean install
|
||||
|
||||
# Default target
|
||||
.DEFAULT_GOAL := start
|
||||
|
||||
# Variables
|
||||
PHP = php
|
||||
HOST = localhost
|
||||
PORT = 8000
|
||||
SERVER_URL = http://$(HOST):$(PORT)
|
||||
|
||||
# Start the PHP development server
|
||||
start:
|
||||
@echo "Starting PHP TODO API server at $(SERVER_URL)"
|
||||
@echo "Available endpoints:"
|
||||
@echo " GET $(SERVER_URL)/ - API info and available endpoints"
|
||||
@echo " GET $(SERVER_URL)/todos - Get all todos"
|
||||
@echo " POST $(SERVER_URL)/todos - Create todo"
|
||||
@echo " PUT $(SERVER_URL)/todos/:id - Update todo"
|
||||
@echo " DELETE $(SERVER_URL)/todos/:id - Delete todo"
|
||||
@echo ""
|
||||
@echo "Press Ctrl+C to stop the server"
|
||||
$(PHP) -S $(HOST):$(PORT)
|
||||
|
||||
# Clean up data file
|
||||
clean:
|
||||
@echo "Cleaning up data..."
|
||||
@rm -f todos.json
|
||||
@echo "Data file removed"
|
Reference in New Issue
Block a user