Giter VIP home page Giter VIP logo

go-rest's Introduction

go-rest

Build Status Go Report Card codecov License: MIT

This is a simple application that interfaces with a PostgreSQL database and exposes a REST API with GET, POST, PUT and DELETE methods to access and manipulate it.

Configuration

The database details are fetched from the following ennvironment variables: db_host - The database server host, e.g localhost db_user - The database server user, e.g root db_port - The port used to access the database server, e.g 5432 db_port - The database password, e.g 1q2w44f5g db_name - The database name, e.g my_database db_type - This should be set to 'postgres'

Running

Simply run 'rest.exe'. The program will be launched on localhost:8000/users. Ensure you have set up the environment variables in your local environment.

Building from source

Prerequisites

You must have a recent version of the Go compiler installed. GOROOT, GOPATH and GOBIN environment variables should be set up for convenience. Visit https://www.golang.org to learn how to set up Go.

The following third-party libraries are required to build the program from the source.

  1. gorilla/mux
  2. jinzhu/gorm
  3. lib/pq
  4. joho/godotenv

Process

Navigate to the program folder and run the go build command. You may also use go install path/to/package to create a binary, or go run path/to/package to compile and run.

go-rest's People

Contributors

peter-mghendi avatar

Watchers

 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.