🏠 Homepage
👤 ** gowebexamples **
👤 ** monkrus **
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator
-
In your terminal, run
sudo tar -C /usr/local -xzf (downloaded go version, e.g. go1.14.linux-amd64.tar.gz) -
Check the correctness by running
ls -ls/usr/local/go -
Edit profile
nano ~/.profileand addexport PATH=$PATH:/usr/local/go/binline to the end of the file. Also export the home directory of the userexport PATH=$PATH:/home/your_directory/go/bin(e.g. export PATH=$PATH:/home/goweb/go/bin )
-
Install unique module
go mod int github.com/monkrus/pseudo-reddit -
Install migration tool
tar -xf migrate,linux-amd64.tar.gz.Then follow bysudo mv migrate.linux-amd64 /usr/local/bin/migrate, checking installation by typingwhich migrate, andmigrate --help -
Install docker https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04
-
After creating makefile, run DB
make postgres,make adminer, and migrationsrun migrate. -
sqlx package is used for DB queries
go get github.com/jmoiron/sqlx -
Download driver for en/decoding messages b/w Go and DB :
go get github.com/lib/pq -
Install chi router :
go get -u github.com/go-chi/chi -
Run server
go run cmd/goreddit/main.go