Giter Site home page Giter Site logo

golearn's Introduction

My First Go with JWT

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. More info: https://golang.org

Getting Started

It's easy to get started.

Set Up GO Environment

Install Go and set GOPATH variable with simply follow the instruction from the video here.

Set Up Project

Move the project to your workspace (i.e. golang/github.com/noorelbahr).

Then open terminal and move to the project directory

cd $GOPATH/github.com/{username}/golearn

Open The Project

Open the project with your code editor and don't forget to download all dependencies :

go get github.com/gorilla/mux
go get github.com/jinzhu/gorm
go get github.com/satori/go.uuid
go get github.com/dgrijalva/jwt-go
go get github.com/joho/godotenv
go get golang.org/x/crypto/bcrypt

Run Our Project

Simply run :

make dev

Or

go run main.go

It will run initial migration for users table and add one default user, use the credential below to hit our login endpoint:

fullname: John Doe
username: johndoe
password: 123123

We can check our localhost on port 8082 (http://localhost:8082)

Testing Our API

To test our API, click button bellow :

Run in Postman

Important!!

The Postman Collection will be updated periodically depends on any changes made to the project.

If you want to get a latest collection, just click on the Run button above and import it as a copy to your Postman App.

You always can do it whenever you want to check for a latest collection. ;)

golearn's People

Contributors

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