Skip to content

glp-92/go-sample-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoLang Blog Backend

Setup

If new to Golang, follow tutorial to setup and run GO provided on main doc page. It's documentation is fine

Once installed, add export PATH=$PATH:/usr/local/go/bin in the end of ~/.profile and reboot.

For a new project

mkdir projectName
cd projectName
go mod init projectName

SQLite

sudo apt install sqlite3

Create database

sqlite3 blogtest.db < db_entrypoint.sql

MySQL

Install MySQL on system (Docker works fine too)

sudo apt install mysql-server -y
sudo systemctl enable mysql.service
mysql -u root -p < db_entrypoint.sql

New dependencies

To use dependencies, as for example google uuid must update go.mod by using following command

go get -u github.com/google/uuid
go get -u github.com/joho/godotenv
go get -u golang.org/x/crypto
go get -u github.com/go-sql-driver/mysql
go get -u github.com/golang-jwt/jwt/v5

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages