Welcome to the Simple CRUD API repository! This project is a basic implementation of a RESTful API using the Go programming language, Gin web framework, and Gorm ORM. This README file provides a quick overview to get you started.
- Create, Read, Update, and Delete operations (CRUD).
- Uses Gin for routing and middleware.
- Utilizes Gorm as an ORM for database interactions.
- Follows RESTful API conventions.
Before you begin, make sure you have the following installed:
-
Clone the repository:
git clone https://github.com/OkbaSalman/simple-go-api.git
-
Change your working directory to the project folder:
cd simple-go-api -
Build and run the application:
go run main.go
The API server should now be running locally at http://localhost:3000.
Here are some example API endpoints and their usage:
-
Create a new post
POST /posts { "Title": "New Post", "Body": "Body of the Post" } -
Retrieve all posts
GET /posts -
Retrieve a single post
GET /posts/{id} -
Update a post
PUT /posts/{id} { "Title": "Updated Post Title", "Body": "Updated Post Body" } -
Delete a post
DELETE /posts/{id}
Please adapt these examples to your specific API endpoints and data structures as needed.
If you'd like to contribute to this project, please follow the typical GitHub workflow:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes.
- Commit your changes.
- Push to your forked repository.
- Create a pull request to the
mainbranch of this repository.
This project is licensed under the MIT License. Feel free to use, modify, and distribute it as needed for your own projects.
Thank you for using and contributing to this Simple CRUD API project! If you have any questions or issues, please don't hesitate to open an issue or reach out to me.