- URL Shortener written in python.
- Swagger Documentation
docker build ./ -t shortlink/api -f ./Dockerfile && \
docker run -it --rm -p 80:8080 shortlink/api
docker build --target tests ./ -t shortlink/api-tests -f ./Dockerfile && \
docker run -it --rm shortlink/api-tests
docker-compose build && docker-compose up
docker build ./ -t shortlink/api -f ./Dockerfile; `
if ($?) {`
docker run -it --rm -p 80:8080 shortlink/api; `
}
docker build --target tests ./ -t shortlink/api-tests -f ./Dockerfile; `
if ($?) {`
docker run -it --rm shortlink/api-tests; `
}
docker-compose build; `
if ($?) {`
docker-compose up; `
}
Name | Default | Available Options | Description |
---|---|---|---|
ENVIRONMENT |
DEV | DEV, QA, STG, PROD | Application environment. |
CONVERSION_BASE |
64 | 2, 8, 16, 32, 64 | What base to use for shortening record keys. |
Name | Default | Available Options | Description |
---|---|---|---|
LOG_FILE |
/shortlink/logs/shortlink.log |
- | Absolute path for log file. e.g. /var/log/short-link/application.log or E:\logs\short-link\application.log |
LOG_LEVEL |
INFO | DEBUG, INFO, WARNING, ERROR, CRITICAL | See python logging levels for more information. |
LOG_FORMAT |
%(asctime)s - [%(name)s] - [%(levelname)s] - %(message)s |
- | Log msg format. With the default, formatting, a message may look like: 2022-02-13 13:53:13,463 - [src.main] - [INFO] - Application started. . See formatters for more information. |
FF_CONSOLE_LOGGING |
True | True, False | If set to true, logs will be directed to console (stdout). |
Name | Default | Available Options | Description |
---|---|---|---|
REDIS_USER |
- | - | Redis username. e.g. short-link-redis-client |
REDIS_PASSWORD |
- | - | Redis password. e.g. ^E05FNf8NHqfRxGIR |
REDIS_HOST |
- | - | Redis host name. e.g. redis.example.com |
REDIS_PORT |
- | - | Redis port. e.g 6379 |
REDIS_URL |
- | - | Redis connection string based on the following template: 'redis://<redis_user>:<self.redis_password>@<redis_host>:<self.redis_port>'. For example: 'redis://short-link-redis-client:^E05FNf8NHqfRxGIR@redis.example.com:6379' Note: If REDIS_URL is set, all other redis configuration options are overridden |
FF_CACHING |
False | True, False | Set to False to disable all caching operations. |
Name | Default | Available Options | Description |
---|---|---|---|
DB_URL |
- | - | Connection url for the database. For example: 'postgresql+psycopg2://short-link:secret@localhost/sl_db'. See database urls for more information |
DB_CONNECT_ARGS |
- | - | Arguments passed directly to the DBAPIs connect() method See connect_args for more information |
USE_IN_MEMORY_SQLITE |
True | True, False | If set to True, all other database settings are ignored and an in memory sqlite database is used. |