URL Shortener written in Go
Find a file
dependabot[bot] 752d8ad1b9
chore(deps): bump github.com/jackc/pgx/v5 from 5.5.2 to 5.5.4
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.5.2 to 5.5.4.
- [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v5.5.2...v5.5.4)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v5
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-14 22:22:55 +00:00
internal chore: cleanup handler 2024-02-09 19:36:05 +01:00
sql fix: return URL if it already exists 2024-01-29 21:37:27 +01:00
.envrc feat: get postgresql URL from env 2024-01-29 21:31:07 +01:00
.gitignore feat: implement retrieve by hash function 2024-01-29 21:31:07 +01:00
atlas.hcl feat: create initial database schema 2024-01-29 21:31:06 +01:00
docker-compose.yaml chore(dev): setup sqlc and atlas 2024-01-29 18:46:59 +01:00
Dockerfile chore: add Dockerfile 2024-01-29 21:32:42 +01:00
flake.lock chore(dev): add flake and .envrc 2024-01-29 18:35:40 +01:00
flake.nix chore(dev): setup sqlc and atlas 2024-01-29 18:46:59 +01:00
gen.go feat: generate OpenAPI server 2024-01-29 21:31:06 +01:00
go.mod chore(deps): bump github.com/jackc/pgx/v5 from 5.5.2 to 5.5.4 2024-03-14 22:22:55 +00:00
go.sum chore(deps): bump github.com/jackc/pgx/v5 from 5.5.2 to 5.5.4 2024-03-14 22:22:55 +00:00
justfile feat: create initial database schema 2024-01-29 21:31:06 +01:00
main.go chore: cleanup main 2024-02-09 19:29:58 +01:00
openapi.yaml style: format openapi 2024-01-29 22:23:23 +01:00
README.md docs: improve readme 2024-01-29 22:25:40 +01:00
sqlc.yaml chore(dev): setup sqlc and atlas 2024-01-29 18:46:59 +01:00

short

URL Shortener written in Go.

Requirements

Note

If you are using Nix, you can just run nix develop . or direnv allow if you use Direnv.

Dev dependencies

  • ogen to generate OpenAPI server

Running the app

Once you have installed all requirements, you can simply do:

docker compose up -d
just migrate # or atlas migrate apply --env local
go run .

Accessing the docs

The docs is using the openapi.yaml provided in the root directory. A web UI is available at http://localhost:8080/docs. It's using Rapidoc under the hood.

Testing

You can simply test using:

# ensure postgres is up
docker compose up -d
go test ./...

It will create database on the fly for each test.