Skip to content

huzairuje/go-echo-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coverage Status Build Status License: MIT

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%