Giter VIP home page Giter VIP logo

golang_api_iseng's Introduction

hi, this is a test I did when applying for a job but because I have wifi problems I missed the deadline. From here I learned that having more than 1 internet device is important

If you want try pleaae follow the step

First Step

open your terminal

run this code :

go mod init golang_api_iseng

or run this code:

go mod init (name your folder project use)

Second Step Library

Gin-gonic

 go get -u github.com/gin-gonic/gin

Gorm

Third Step

 go get -u gorm.io/gorm

Library for postgresql

go get gorm.io/driver/postgres

Fourth Step

make new db and input your user, password, and dbname in file db.go in folder database

var (
	host     = "localhost"
	user     = "" //please input your user db
	password = "" //please input your pass db
	dBport   = "5432"
	dBname   = ""
	db       *gorm.DB
	err      error
)

Open the file db.go in folder database search this code

//db.Debug().AutoMigrate()

uncomment this code because this code make table in your database

And fill your database user and password

Testing

For the test in my rest-api, you can use this postman

https://api.postman.com/collections/13916221-79056d87-af9c-4b08-89f7-428ba37194d6?access_key=PMAT-01GN5F7A66PBCQGFXKY0XB1NP2

I think i will deploy using railwayy

golang_api_iseng's People

Contributors

ranks72 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.