cmalu-urli

command module
v0.0.0-...-27ee9af Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

README

Cmalu Urli

A small link shortner written in GoLang.

Config

Copy the env-example file to .env and then edit the variables.

Example:

cp ./env-example .env
nano .env

Example .env:

MYSQL_USER="bruh"
MYSQL_PASSWORD="VeryStrongPassword"
MYSQL_DATABASE="cmalu_urli"
MARIADB_RANDOM_ROOT_PASSWORD="true"

Run?

To run it using docker, just do docker compose up -d --build. To run it on local, run go mod download && go run . (On local the port is 8080)

How?

Use curl -d '{"original_url": "URL"}' localhost:42069/cmalu to recieve a short link which expires in 24 hours.

Example:

$ curl -d '{"original_url": "https://google.com"}' localhost:42069/cmalu

http://localhost:42069/c/abcde

This link should redirect to the original_url.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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