X-Press Publishing / DB path

Hi there!

I am working on the project X-press publishing: https://www.codecademy.com/paths/web-development/tracks/building-a-persistent-api/modules/persistent-api-cumulative-projects/projects/x-press-publishing

I can’t understand why should we declare DB path as ‘./database.sqlite’ in files artists, issues and serias. This path points at the current api directory, but our DB is not in the current directory.

I’ve found the answer in the other project:

" Note: When loading database.sqlite in your JavaScript files, sqlite3 will always try to load database.sqlite from the root directory path, ./database.sqlite , regardless of where the current file is located. Therefore your code will always be new sqlite3.Database(process.env.TEST_DATABASE || './database.sqlite') regardless of the file you are writing in"