Learn-Crystal
Learn-Crystal
Project Description
This project is a simple API server built with the Crystal programming language. The purpose of this project is to demonstrate how to create a basic API server using Crystal, including handling HTTP requests, serializing JSON data, and managing sample data.
Installation Instructions
- Dependencies: Ensure you have Crystal installed on your system. You can download and install Crystal from the official website: https://crystal-lang.org/install/
- Clone the repository:
git clone https://github.com/Zxce3/Learn-Crystal.git cd Learn-Crystal
- Install dependencies:
shards install
Usage Examples
-
Run the server:
crystal run src/api.cr
The server will start running at
http://localhost:3000
. -
Make API requests:
- Get all users:
curl http://localhost:3000/api/users
- Get a user by ID:
curl http://localhost:3000/api/users/1
- Get all users:
API Endpoints
- GET /api/users: Returns a list of all users.
- GET /api/users/:id: Returns a user with the specified ID.
Authors and Contributors
- Zxce3
Repository
Learn-Crystal
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- 3 months ago
- March 24, 2025
License
Links
Synced at
Thu, 26 Jun 2025 05:44:53 GMT
Languages