ShortURLGenerator

module
v0.0.0-...-903a698 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2022 License: MIT

README

Short URL Generator (shurl.ml)

This is a simple project for understanding how to work with GIN, PostgresSQL and Redis in golang. There is a Russian version of this project on YouTube for more clarification.

Playlist: click

Running this on the server

Prerequisites
Edit this in the env/app.env
VIRTUAL_HOST=yourdomain.com
LETSENCRYPT_HOST=yourdomain.com
LETSENCRYPT_EMAIL=your@mail.com
Edit this in the env/email.env
SENDER_EMAIL=your@mail.com
EMAIL_PASSWORD=mysecretpassword
SMTP_ADDRESS=smtp.google.ru
Edit this in the env/bot.env

You can get the token for the bot here.

API_TOKEN=0123456789:abcdefghijklmnopqrstuvwxyz123456789
BOT_USERNAME=mybotname_bot
And then run it with this command
docker-compose up -d --build

Change the PG administrator's data

Edit this in the env/pg.env
POSTGRES_USER=postgres
POSTGRES_PASSWORD=mysecretpassword
POSTGRES_DB=shorturldb

And recreate the container if it has already been created, otherwise run it.

Directories

Path Synopsis
Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT This file was generated by swaggo/swag
Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT This file was generated by swaggo/swag
pkg
pg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL