This is a simple Flask API that connects to a PostgreSQL database.
-
Install PostgreSQL:
Make sure you have PostgreSQL installed and running on your machine.
-
Create a database and table:
CREATE DATABASE your_db; \c your_db; CREATE TABLE items (id serial PRIMARY KEY, name VARCHAR(50));
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python app.py
The API will be running at http://127.0.0.1:5000.