Skip to content

senja24/golang-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang API with Gin and GORM

This is a simple RESTful API built with Go using the Gin web framework and GORM for database interactions. The API allows for creating and retrieving posts.

Features

  • Create new post
  • Get post by id
  • Edit post by id
  • Delete post by id
  • Retrieve all posts

Technologies Used

Getting Started

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/senja24/golang-api.git
cd golang-api
  1. Install dependencies
  2. Set up database
  3. Run the application:
go run main.go

API Endpoints

  1. Get all posts
GET /api/posts
  1. Create a new post
POST /api/posts
  1. Get post by id
GET /api/posts/:id
  1. Edit post by id
PUT /api/posts/:id
  1. Delete post by id
DELETE /api/posts/:id

Project Structure

. ├── controllers │ └── postsController.go ├── models │ ├── post.go │ └── setup.go ├── main.go └── go.mod

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages