The examples have been written and tested with Python 3. The examples require additional Python packages to be installed. These packages can be installed using \texttt{pip} or \texttt{pip3}, depending on the Python~3 installation. The command to install the packages is given in Listing~\ref{listing:pip}, where the \texttt{requirements.txt} file is provided in this repository.
The examples have been written and tested with Python 3. The examples require additional Python packages to be installed. These packages can be installed using \texttt{pip} or \texttt{pip3}, depending on the Python~3 installation. The command to install the packages is given in Listing~\ref{listing:pip}, where the \texttt{requirements.txt} file is provided in this repository in the \texttt{src} directory.
\item Check the tables present and remove any existing tables.
\item Check the tables present and remove any existing tables by using Listing~\ref{listing:list-tables} and \ref{listing:db-reset}, respectively. The Listing~\ref{listing:db-reset} assumes that the teaching environment is being used.
\begin{lstlisting}[caption={Listing the tables and columns.},label=listing:list-tables,numbers=none,language=,showspaces=true]
SHOW TABLES;
SHOW COLUMNS IN book;
\end{lstlisting}
\begin{lstlisting}[caption={Creating an empty database, where \texttt{db\_user} should be replaced by the database user name.},label=listing:db-reset,numbers=none,language=,showspaces=true]
DROP DATABASE IF EXISTS db_user;
CREATE DATABASE db_user;
\end{lstlisting}
\end{enumerate}
\subsection{Remote database}
...
...
@@ -155,9 +166,18 @@ It is easier to debug a program when it is running on the local computer, since
\begin{enumerate}
\item Set the environment variables.
\item Run the web service on the local computer, using the Azure MariaDB database.
\item Verify the end points work as expected.
\item Verify the end points work as expected by using Listing~\ref{listing:web-service-test}.
\begin{lstlisting}[caption={Testing the web service.},label=listing:web-service-test,numbers=none,language=,showspaces=true]
curl -s -X GET "http://127.0.0.1:5000/books/"
curl -s -X POST -H "Content-Type: application/json" \