Skip to content

tharaka911/nawwa-go-redis-api

Repository files navigation

install go in ubuntu server
cd /tmp && wget https://go.dev/dl/go1.22.2.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.22.2.linux-amd64.tar.gz
open the bashrc under root user
cd && nano .bashrc
add below line at the below of .bashrc
export PATH=$PATH:/usr/local/go/bin
save and exit
reload the bashrc
source .bashrc

1. clone the code

git clone https://github.com/tharaka911/nawwa-go-redis-api.git

2. run the application

go run main.go

3. build the binaries

go build main.go

how to run go binaries as a service in linux

nano /lib/systemd/system/nawwa-go-redis-api.service

adding the below lines to golanghttp.service

[Unit]
Description=nawwa-go-redis-api
[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStart=<executable location>/main
WorkingDirectory=<executable location>
[Install]
WantedBy=multi-user.target

View the logs

last logs ->
journalctl -xeu nawwa-go-redis-api
live logs ->
journalctl -xeu nawwa-go-redis-api -f

service manipulation

service nawwa-go-redis-api start
service nawwa-go-redis-api status
service nawwa-go-redis-api stop

About

nawwa-go-redis-api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages