Todo App with Auth using GORM
This project demonstrates a Todo application with authentication using GORM.
Prerequisites
Ensure you have the following installed and available in your GOPATH
:
Installation
-
Clone the repository:
git clone https://github.com/gofiber/recipes.git
cd recipes/todo-app-with-auth-gorm -
Install dependencies:
go get
Running the Application
- Start the application:
air
Environment Variables
Create a .env
file in the root directory and add the following variables:
# PORT returns the server listening port
# default: 5000
PORT=
# DB returns the name of the sqlite database
# default: gotodo.db
DB=
# TOKENKEY returns the jwt token secret
TOKENKEY=
# TOKENEXP returns the jwt token expiration duration.
# Should be time.ParseDuration string. Source: https://golang.org/pkg/time/#ParseDuration
# default: 10h
TOKENEXP=