I eat your links!

Izuru Yakumo eab6ac1e71 doc: add more comments 4 months ago
cmd f79bf81d51 [...] 4 months ago
internal eab6ac1e71 doc: add more comments 4 months ago
.gitignore f79bf81d51 [...] 4 months ago
LICENSE 68fbd58b85 Add makefile, update license and readme 4 months ago
Makefile 68fbd58b85 Add makefile, update license and readme 4 months ago
config.json b299605836 Did a lot of things, notable ones were removing Docker and sqlite3 4 months ago
doc.go f79bf81d51 [...] 4 months ago
go.mod f79bf81d51 [...] 4 months ago
go.sum f79bf81d51 [...] 4 months ago
item.go b299605836 Did a lot of things, notable ones were removing Docker and sqlite3 4 months ago
readme.md 68fbd58b85 Add makefile, update license and readme 4 months ago
version.go b299605836 Did a lot of things, notable ones were removing Docker and sqlite3 4 months ago

readme.md

rumia

URL shortener service named after Rumia from Touhou 6: Embodiment of Scarlet Devil

Run

Code Example

Using CURL Generate shortener

$ curl -H "Content-Type: application/json" -X POST -d '{"url":"www.google.com"}' http://localhost:8080/encode/
<!-- Response: -->
<!-- {"success":true,"response":"http://localhost:8080/1"} -->

Redirect Open url in your browser http://localhost:8080/bN

OR

curl http://localhost:8080/1

Get info for url shortener\ curl http://localhost:8080/info/1

Response:

{
 "success":true,
 "response": {
    "url":"www.google.com",
    "visited":true,
    "count":1
 }
}

Installation

go install marisa.chaotic.ninja/rumia/cmd/rumia@latest

Storage backend

rumia requires PostgreSQL (>=10.0) to work properly.

createuser -P rumia
createdb -O rumia rumia_db

Add your config for the method of persistence and other options in file config.json

{
  "server": {
    "host": "0.0.0.0",
    "port": "8080"
  },
  "options": {
    "prefix": "http://localhost:8080/"
  },
  "postgres": {
    "user": "rumia",
    "password": "<password>",
    "db": "rumia_db"
  }
}

Contributors

  • Douglas Makey Mendez Molero (original author)
  • Izuru Yakumo (maintainer)

License

  • MIT