Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nk521/cmalu-urli
https://github.com/nk521/cmalu-urli
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nk521/cmalu-urli
- Owner: nk521
- License: gpl-3.0
- Created: 2023-02-01T14:27:56.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-06T08:19:31.000Z (almost 2 years ago)
- Last Synced: 2024-06-20T19:33:07.007Z (6 months ago)
- Language: Go
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cmalu Urli
A small link shortner written in GoLang.
## Config
Copy the `env-example` file to `.env` and then edit the variables.Example:
```bash
cp ./env-example .env
nano .env
```Example `.env`:
```text
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:
```bash
$ curl -d '{"original_url": "https://google.com"}' localhost:42069/cmaluhttp://localhost:42069/c/abcde
```This link should redirect to the `original_url`.