Coder Social home page Coder Social logo

rest-api's Introduction

TANIM

Uygulama REST API ile endpointlere gelen HTTP isteklerine database üzerinde işlem yaparak cevap vermektedir.

Kullanılan Teknolojiler

Bu uygulamada Gin Web Framework ile Gorm ORM Kütüphanesi kullanılmaktadır.

Bağımlılıklar

go get -u github.com/gin-gonic/gin
go get -u github.com/jinzhu/gorm
go get github.com/mattn/go-sqlite3

Uygulamanın başlatılması

Uygulama /backend klasörü içinde aşağıdaki komut ile başlatılır.

go run main.go

Uygulamanın Çalıştığı Port

Uygulama 8085 portunu dinlemektedir.

Uygulamanın Dinlediği Uç Noktalar

Method URI Fonksiyon
GET /user/ main.GetUsers
GET /user/:id main.GetUser
POST /user main.CreateUser
DELETE /user/:id main.DeleteUser
PUT /user/:id main.UpdateUser

Örnek bir JSON çıktısı

{
    "ID": 1,
    "CreatedAt": "2019-04-20T22:02:04.648969408+03:00",
    "UpdatedAt": "2019-04-20T22:02:04.648969408+03:00",
    "DeletedAt": null,
    "username": "saffetblt",
    "name": "Saffet",
    "surname": "BULUT",
    "password": "12345",
    "email": "[email protected]",
    "phone": "555 444 33 22",
    "age": 25,
    "country": "Turkey",
    "city": "Ankara"
}

Örnek HTTP istekleri

GET

192.168.0.12:8085/user/
192.168.0.12:8085/user/5

POST

192.168.0.12:8085/user/

DELETE

192.168.0.12:8085/user/4

PUT

192.168.0.12:8085/user/3

Öneriler

Http istekleri için Postman programı kullanılmaktadır.

.db uzantılı database dosyasını görüntülemek için DB Browser for SQLite kullanılmaktadır.

rest-api's People

Contributors

saffetblt avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.