This project provides a simple, fake REST API using Symfony for testing purposes. It's designed to simulate basic user-related operations such as fetching user details, creating a new user, and deleting a user. The data is stored in a JSON file, making it lightweight and easy to manipulate.
To set up this project, follow these steps:
- Clone the repository:
git clone https://github.com/darkotodoric/fake-rest-api
- Start the Docker
docker-compose up -d
- Install dependencies:
docker exec -it fakerestapi-php-container php composer.phar install
- Start using API
curl -X GET "http://localhost:1337/users"
The API provides the following endpoints:
GET /users
: List all users.POST /users
: Create a new user.GET /users/{id}
: Get details of a user by their ID.DELETE /users/{id}
: Delete a user by their ID.GET /headers
: List of headers
The user data is stored in data/users.json
. Each user object typically contains the following fields:
id
: Unique identifier for the user.first_name
: First name of the user.last_name
: Last name of the user.username
: Username of the user.email
: Email address of the user.- (Other fields as required).