URL Shortener written in Go
752d8ad1b9
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> |
||
---|---|---|
internal | ||
sql | ||
.envrc | ||
.gitignore | ||
atlas.hcl | ||
docker-compose.yaml | ||
Dockerfile | ||
flake.lock | ||
flake.nix | ||
gen.go | ||
go.mod | ||
go.sum | ||
justfile | ||
main.go | ||
openapi.yaml | ||
README.md | ||
sqlc.yaml |
short
URL Shortener written in Go.
Requirements
- go 1.21.6 or more
- Docker
- atlas
- sqlc
- just (optional)
Note
If you are using Nix, you can just run
nix develop .
ordirenv 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.