Skip to content

Commit

Permalink
doc: Add README
Browse files Browse the repository at this point in the history
* chore: Add port to docker run command
  • Loading branch information
mehmetumit committed Nov 7, 2023
1 parent 44355c7 commit 35616df
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ docker-build:

.PHONY: docker-run
docker-run:
@docker run --rm $(IMG):$(TAG)
@docker run -p 8080:8080 --rm $(IMG):$(TAG)
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<h1 align="center">dexus</h1>
<p align="center">
<img src="https://img.shields.io/github/stars/mehmetumit/dexus?color=yellow" alt="Stars"/>
<img src="https://img.shields.io/github/license/MehmetUmit/dexus" alt="License"/>
</p>

---

## About

Dexus is a URL shortener that provides you with the ability to extend it dynamically according to your needs. You can utilize existing adapters or implement your own adapters based on ports. Afterward, you only need to inject these adapters in [cmd/main.go](./cmd/main.go). Contributions of any new adapters are welcome.

## Usage
### Using binary release
Precompiled binaries are available on the [relases](https://github.com/mehmetumit/dexus/releases) page.
### Local Usage
```sh
# Clone the repository
git clone https://github.com/mehmetumit/dexus.git
# Change directory
cd dexus
# Build and run with make
make exec
# Or just build as "./build/dexus"
make build
```
### Using Docker
```sh
# Clone the repository
git clone https://github.com/mehmetumit/dexus.git
# Change directory
cd dexus
# Build image with make
make docker-build
# Run image with make
make docker-run
# Or manually
docker run -p 8080:8080 dexus:latest
```
### Development
```sh
# Live reload using 'entr'
make live-reload
```
```sh
# Run tests and get coverage
make test
```
```sh
# Run tests and get coverage with html output
make test-coverage-html
```
## Configuration

| Env Vars | Default Values |
|----------------------|----------------------------|
| `DEBUG_LEVEL` | `true` |
| `HOST` | `all interfaces` |
| `PORT` | `8080` |
| `READ_TIMEOUT_MS` | `1000 ms` |
| `WRITE_TIMEOUT_MS` | `1000 ms` |
| `CACHE_TTL_SEC` | `60 s` |
| `YAML_REDIRECT_PATH` | `configs/redirection.yaml` |

## Contributing
Greatly appreciate contributions from the community. Your input, whether it's through code, documentation, bug reports, or suggestions, helps improve this project and make it even better.
## License
This project is licensed under the [GPLv3](./LICENSE) License.

0 comments on commit 35616df

Please sign in to comment.