Coder Social home page Coder Social logo

goapi-example's Introduction

Nature API

Api of example in Go

System requirements

  • Go 1.13x
  • Docker 18x
  • Docker Compose 1.25x

Application requirements

  • MongoDB lastest version
  • Redis lastest version

System commands

  • Start application $ make run
  • Build docker $ docker built -t {your name} .
  • Start docker compose $ docker-compose up -d

Envirolment variables

  • MONGO_URL - set your mongo database url
  • REDIS_URL - set redis url
  • PORT - set port when server execute

obs.: In developer mode and makefile has be configurated

Developer guide

Create a new feature or fix using style guide down:

  • feature/{name of feature}
  • feature-fix/{name of fix feature}
  • bug-fix/{name your case or order ticket}
  • hot-fix/{name of case or order ticket case}

Create a new pull request and request reviwers

Api reference

Allowed methods:

  • GET /v1/products - Return all products
  • GET /v1/products/:id - Return a product by id
  • POST /v1/products - Create a new product
  • PUT /v1/products/:id - Update product by id
  • DELETE /v1/products/:id - Delele a product by id WARNING this method remove data from database

Response types:

Status Description
200 Success ok
400 Invalid request
404 Resource not found or data not found
422 Used on validate input data invalid
500 Internal server error

JSON Input:

{
    "name": "My Product",
    "description":"My product description",
    "price": 99.99,
    "currency_code": "BRL",
    "images": [
        "https://hbr.org/resources/images/article_assets/2017/10/oct17-11-740519323.jpg",
    ]
}

Especial area, links of references

goapi-example's People

Contributors

jeffersonsc2018 avatar jeffersonsc avatar

Watchers

James Cloos avatar  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.