Skip to content

chavakula/simple-rest-service-golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Simple REST service in GOLANG

This example will show you how to quickly create a REST service in GOLANG. (Without Database support)

Installation

Use the package manager dep to install dependencies for this project.

Usage

cd src/restservice
go run main.go

server will be up at http://localhost:8000

REST CALLS

Endpoint : http://localhost:8000/api/sayhello

Method : GET

Output :

{
    "data": {
        "name": "Rajshekar",
        "phone": "+91-9922616111",
        "email": "[email protected]"
    },
    "message": "success",
    "status": true
}

Endpoint : http://localhost:8000/api/sayhello

Method : POST

Input :

{"name":"Json","phone":"9922616111","email":"[email protected]"}

Output :

{
    "data": {
        "name": "Json",
        "phone": "9922616111",
        "email": "[email protected]"
    },
    "message": "success",
    "status": true
}

About

Simple rest service in golang without database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages