Skip to content

ReST API Development using GoLang - Simple CRUD API Endpoints...

Notifications You must be signed in to change notification settings

ManiruzzamanAkash/GoLang-Rest-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

GoLang-Rest-API

Simple ReST API Using Go Lang


What's Included

  1. A Simple ReST API using Go Lang
  2. Mux Router
  3. Currently data managed from memory

@Todo

  1. Add Database Configuration
  2. Make architecture for Big One

How to start

Step 1: Install Go language on your machine.

Step 2: Clone this repository

git clone https://github.com/ManiruzzamanAkash/GoLang-Rest-API.git

Step 3: Go to that project, if you're on another directory.

Rename the folder to something else -

goapi-test

Go to that folder -

cd goapi-test

Step 4: Build App

go build

Step 5: Run

./goapi-test

Test the API Endpoints:**

All Books

URL: http://localhost:8000/api/books

Method: get

Get Single Book URL: http://localhost:8000/api/books/1

Method: get

Create a book -

URL: http://localhost:8000/api/books

Method: post

{
	"Title" : "Book Created",
	"Isbn": "819289823",
	"Author": {
		"FirstName": "Maniruzzaman",
		"LastName": "Akash"
	}
}

Update a Book

URL: http://localhost:8000/api/books/2

Method: put

Where 2 is the ID

{
	"Title" : "Book Updated for 2",
	"Isbn": "819289823",
	"Author": {
		"FirstName": "Maniruzzaman",
		"LastName": "Akash"
	}
}

Delete a Book

URL: http://localhost:8000/api/books/31847

Method: delete

Where 31847 is the ID

About

ReST API Development using GoLang - Simple CRUD API Endpoints...

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages