Giter VIP home page Giter VIP logo

urless's Introduction

logo

![Docker Image CI](https://github.com/alivx/urless/workflows/Docker%20Image%20CI/badge.svg) # URLess

URL Shortener API Service

self-hostable open-source URL shortening web API service with a Fast API. It allows you to host your own URL shorten easy to use.

Screenshots

sample1

Quickstart

Urless is written in Python, using Redis as its primary database.( TODO redisgears + mysql)

Installation

Download the latest version of URLess via this image 'alivx/urless'.

docker-compose build #To build project
docker-compose up #To run project, You can use `-d` option to run it in the background.

To test service run CURL command:

curl --location --request POST 'http://127.0.0.1:8000/' \
--header 'Content-Type: application/json' \
--data-raw '{"url":"www.google.com"}'

OR from browser open localhost and start testing the system.

Configs

To Deal with config for each app, you have two method.

  1. settings.yaml
  2. enviromnet varables. (This will override settings.yaml value)

In point 2, just use DYNACONF_[valueName], for example, in our API there is a config called exposePort, to override it use this value DYNACONF_exposePort. such as export DYNACONF_exposePort=1991

If you want to use a custom config under docker-compose, just add it under environment section as explained above.

docker-compose-env-vars

You can change value for each service config under file settings.yaml

frontend-config

For nginx, you must change the config file under infrastructure/nginx/urless.conf if you changes frontend container name or port.

nginx


You can check the API documntion by /docs APiDocs

urless's People

Contributors

alivx avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

syllogy jarek-bir

urless's Issues

There is a runtime error under frontend server

Error:

127.0.0.1 - - [28/Dec/2020 22:26:42] "GET /?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Dec/2020 22:26:42] "GET /?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [28/Dec/2020 22:26:42] "GET /?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Dec/2020 22:26:42] "GET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
127.0.0.1 - - [28/Dec/2020 22:26:42] "GET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
127.0.0.1 - - [28/Dec/2020 22:26:48] "POST / HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/omar/Desktop/SS/urless/env/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/omar/Desktop/SS/urless/env/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/home/omar/Desktop/SS/urless/env/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/omar/Desktop/SS/urless/env/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/omar/Desktop/SS/urless/env/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/omar/Desktop/SS/urless/env/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/omar/Desktop/SS/urless/env/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/omar/Desktop/SS/urless/env/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/omar/Desktop/SS/urless/env/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/omar/Desktop/SS/urless/env/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/omar/Desktop/SS/urless/frontend/main.py", line 34, in login
    newShortCode = str(data["short"])
TypeError: 'NoneType' object is not subscriptable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.