- Create an
.env
file and add the following variables.
DB_HOST=127.0.0.1 DB_DRIVER=mysql DB_USER=root DB_PASSWORD= DB_NAME=real-chat-backend-db DB_PORT=3306 TOKEN_HOUR_LIFESPAN=1 API_SECRET=My_API_Secret_Key
- Run the MySQL server
Can be used the Xampp, navicat or another things
- In the root directory, please run
go mod init and go mod tidy
- Run
go run main.go