Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 1.11 KB

README.md

File metadata and controls

51 lines (39 loc) · 1.11 KB

Go REST API Example

A RESTful API with Go

It is a just simple tutorial or example for making simple RESTful API with Go using gorilla/mux (A nice mux library) and mgo.v2 (MongoDb Driver)

Installation & Run

# Download this project
go get github.com/ConstantineGochev/go_api
# Build and Run
cd go_api
go build
./go_api

# API Endpoint : http://127.0.0.1:3000

Structure

├── app
│   ├── app.go
├── controllers         // Our API logic controllers
│   ├── common.go    // Common response functions
│   ├── news.go  // APIs for News model
├── models
│   ├── news.go // Models for our application
├── config
│   └── config.go        // Configuration
└── main.go

API

/news

  • GET : Get all news
  • POST : Create a new project

Todo

  • Support basic REST APIs.
  • Support Authentication with user for securing the APIs.
  • Make convenient wrappers for creating API handlers.
  • Write the tests for all APIs.
  • Organize the code with packages
  • Building a deployment process with Docker