This example implements a Flask server that uses a relational database, in this case PostgreSQL.
The goal is to show how to setup a relational database with mobync.
We recommend you create a python virtual environment. Run:
python3 -m venv venvRun:
pip install -r requirements.txtRun:
python app.pyNow the server will be running on your localhost
This is the sync endpoint, with it you can perform operations defined on mobync's protocol.
With this endpoint you can list the current state of the mock database.
If error:
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
run:
brew services stop postgresql
rm /usr/local/var/postgres/postmaster.pid # adjust path accordingly to your install
brew services start postgresql
if doesn't work, try:
rm -rf /usr/local/var/postgres && initdb /usr/local/var/postgres -E utf8