This is a simple project demonstrating how to implement JWT (JSON Web Tokens) authentication in a Golang web application using the Gin framework.
- Go (Golang) installed on your machine.
- Understanding of basic Golang concepts.
- Basic knowledge of JWT (JSON Web Tokens).
-
Clone the repository:
git clone https://github.com/Prasenjit43/golang-jwt-project.git
-
Navigate to the project directory:
cd golang-jwt-project -
Install dependencies:
go mod tidy
-
Start the server:
go run main.go
-
By default, the server runs on port
8000. You can specify a different port by setting thePORTenvironment variable:PORT=8080 go run main.go
-
Once the server is running, you can test the endpoints using tools like cURL or Postman.
/auth: Endpoint for authentication./user: Endpoint for user authentication.