This is the API server and database from the now stale and offline project, breakingbadapi.com. After conducting a detailed examination and investigation, I was able to reconstruct the database and update the dependencies to get it up and running. I created this repository to assist others participating in The Vue 3 Bootcamp course on udemy.com. By following the instructions in this README, you should be able to spin up a local API server that will aid in completing section 9 of the course.
-
Install PostgreSQL appropriate for your system.
-
Create the database using the following command:
createdb -U postgres breakingbad
- Seed the database using:
psql -U postgres -d breakingbad -f ./db/schema.db
For convenience, a Makefile with rules to assist in database creation is provided if you are able to run make
. You may also want to set the PGPASSWORD
environment variable to your PostgreSQL user password to avoid repeated password prompts.
- Install the dependencies with:
npm install
- Set the
CONNECTION_STRING
environment variable in your shell session to connect to the database. For instance:
CONNECTION_STRING=postgresql://postgres:postgres@localhost:5432/breakingbad
Here, the first postgres
represents the user and the second stands for the password.
- Run the API server:
npm run build
npm run start
To view the API documentation, direct your browser to http://localhost:8080/documentation
.
In lecture 70 of the course, the only necessary modification is the URL for data fetching. Replace:
http://breakingbadapi.com/api/characters
with:
http://localhost:8080/api/characters