Skip to content

gbLw1/go-mvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ToDo App

This is a ToDo MVC app with Go

Dependencies

Database

Setting up the project

Follow the steps below to set up the project.

Environment variables

create a new .env file in the root directory and add the following:

PORT=8080
DB_URL="host=localhost user=gorm password=gorm dbname=gorm port=5432 sslmode=disable"

PORT is the port where the API will run (default: 8080). You can change it if you want.

DB_URL is the connection string for the database. Change it according to your database credentials.

Running with Air (optional)

Air is a tool for running Go applications in the background, refreshing whenever it is modified.

ps: You can change the .air.toml file with your configs if you want.

With air installed, run the following command:

air

Running the project

Run the following command

go run ./cmd/main.go