GitXplorerGitXplorer
R

prisma-flask-url-shortener

public
0 stars
0 forks
0 issues

Commits

List of commits on branch main.
Verified
b1af5bb230728f6b650b7d1f126af2214b97cd55

chore: minor formatting change

RRobertCraigie committed 3 years ago
Verified
0b93af8696ffbbd6e3b175899537ea59230d7ecd

feat(init): initial commit

RRobertCraigie committed 3 years ago

README

The README file for this repository.

Flask URL Shortener Example

This example uses the Flask micro framework to create a basic URL shortener using Prisma.

The code in this example has been modified from: https://www.digitalocean.com/community/tutorials/how-to-make-a-url-shortener-with-flask-and-sqlite

Setup

Create and activate a virtual environment

python3 -m venv .venv
source .venv/bin/activate

Install requirements

pip install -U -r requirements.txt

Setup the database and generate the prisma client

prisma db push

Run the Flask HTTP server

export FLASK_APP=app
export FLASK_ENV=development
flask run

Try out the URL Shortener by opening http://127.0.0.1:5000 in your browser!

Type Checking

If you want to modify the code you should also type check it, you can do so with pyright.

Install

For full disclosure it should be noted that I maintain the PyPi package for pyright which is a wrapper over the official version

pip install -U -r types.txt pyright

Run

pyright