go-echo-api

command module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2020 License: MIT Imports: 14 Imported by: 0

README

Coverage Status Build Status

REST API Go (Echo HTTP Framework)

Introduction

here's making REST API with echo Framework (Go Programming Language), using module based frame thinking

Installation

1. Requirements
a. Golang Language SDK minimal 1.13 https://golang.org/dl/
c. Database (PostgreSQL)
2.Clone The Projects

Go to your src/ folder inside go project directory

    cd ~YOUR/GO/FOLDER/DIRECTORY/src/

then clone the project

    git clone https://github.com/alpakih/go-echo-api.git
3. install all the dependencies

a. Go to the project folder

    cd ~YOUR/GO/FOLDER/DIRECTORY/src/go-echo-api/

b. then run dep ensure command.

Database

Firstly you need a Database, and add new database name with go-echo-api

.Env (environment variable)

Make sure dep ensure is successful, and then make .env file with command

    cp .env.example .env

Update the content of .env value, like the database name

    DB_DRIVER=postgres
    DB_NAME=echo-api
    DB_PORT=5432
    DB_HOST=localhost
    DB_USERNAME=postgres
    DB_PASSWORD=postgres
    DB_SSL=disable

Run

run the project with

    go run main.go

Build

1. Linux
    #build for linux (arch amd64)
    env GOOS=linux GOARCH=amd64 go build -o go-echo-api-linux-amd64  && mv ./go-echo-api-linux-amd64 ./build/
2. MacOs (Darwin / BSD)
    #build for MacOs (arch amd64)
    env GOOS=darwin GOARCH=amd64 go build -o go-echo-api-darwin-amd64  && mv ./go-echo-api-darwin-amd64 ./build/
3. Windows (DOS)
    #build for Windows (arch amd64)
    env GOOS=windows GOARCH=amd64 go build -o go-echo-api-windows-amd64.exe  && mv ./go-echo-api-windows-amd64.exe ./build/

License

This package is open-sourced software licensed under the MIT license.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
infrastructure

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL