To install FlexiREST, follow these steps:
config/database_example.php file to config/database.php and configure your database settings.config/auth_example.php file to config/auth.php and set the JWT secret key.config/api.php file.FlexiREST requires the configuration of several files to function correctly:
To use the API with JWT authentication, include the JWT token in the Authorization header of your requests.
curl -X GET http://localhost/api/users -H "Authorization: Bearer your_jwt_token_here"
FlexiREST allows filtering access to the API based on IP addresses. You can configure allowed and blocked IP addresses in the config/api.php file. IP filtering can be enabled or disabled globally using the enabled option in the configuration. You can also set specific IP access limits by adding IP addresses to the allowed and blocked arrays in the ip_filters section.
curl -X GET http://localhost/api/users
curl -X POST http://localhost/api/users -H "Content-Type: application/json" -d '{"name": "John Doe", "email": "john.doe@example.com"}'
curl -X GET http://localhost/api/users/1
curl -X PUT http://localhost/api/users/1 -H "Content-Type: application/json" -d '{"name": "Jane Doe", "email": "jane.doe@example.com"}'
curl -X DELETE http://localhost/api/users/1
FlexiREST allows filtering results based on column values. Use the endpoint GET /api/{table}/{column}/{value} to filter results.
curl -X GET "http://localhost/api/users/email/john.doe@example.com"
FlexiREST supports pagination to help manage large datasets. Use the page and itemsPerPage query parameters to control pagination.
curl -X GET "http://localhost/api/users?page=2&itemsPerPage=5"
To use the API with JWT authentication, include the JWT token in the Authorization header of your requests.
curl -X GET http://localhost/api/users -H "Authorization: Bearer your_jwt_token_here"
You can access the full API documentation using Swagger UI at:
http://localhost/api/docs.html
This interactive documentation provides detailed information about all available endpoints, request parameters, and response formats.