Skip to content
Snippets Groups Projects
Commit 3a6bd68a authored by William Bell's avatar William Bell
Browse files

Adding more information

parent 6f4e5216
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -99,7 +99,7 @@ which mysql
\end{lstlisting}
\subsection{Python packages}
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.
\begin{lstlisting}[caption={Installing Python package dependencies.},label=listing:pip,numbers=none,language=Bash,showspaces=true]
pip install -r requirements.txt
......@@ -146,7 +146,18 @@ mysql --host $db_server \
--tls-version="TLSv1.2,TLSv1.3" $db_name
\end{lstlisting}
\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" \
-d '{"title": "Ulysses", "author": "James Joyce"}' \
"http://127.0.0.1:5000/books/"
curl -s -X GET "http://127.0.0.1:5000/books/"
\end{lstlisting}
\item Stop the web service.
\item Verify the database table structure using the MariaDB client.
\item Verify the database table structure using the MariaDB client and Listing~\ref{listing:list-tables}.
\end{enumerate}
\subsection{Deploying the web service}
......@@ -217,6 +237,8 @@ curl -s -X GET "https://$app_name.azurewebsites.net/books/"
az webapp delete --name $app_name --resource-group $resource_group
\end{lstlisting}
\item Remove the database tables using the MariaDB client and Listing~\ref{listing:db-reset}.
\end{enumerate}
\end{document}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment