This is a web app that serves an index.html file and a data API from a Python web server, and reads data from a SQLite database. The index.html file uses Vue.js to call the data API and display the results in a table. The web app includes error handling and a loading state.
- Install Python 3 and SQLite.
- Clone this repository.
- Install the required packages using
pip install -r requirements.txt
. - Seed the database with example data using
python seed.py
. - Start the web server using
python server.py
. - Open a web browser and go to http://localhost.
The web app has two endpoints:
/
serves theindex.html
file, which displays a table of data from the database./api/data
returns an array of JSON objects containing data from the database. If the data cannot be loaded due to an error, an error message will be displayed instead of the table.
This project is licensed under the MIT License. See the LICENSE file for details.