Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 982 Bytes

README.md

File metadata and controls

57 lines (43 loc) · 982 Bytes

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
}