Note: For this exercise, we have provided an .env
file with the database connection string. Normally, you would not commit this file to version control. We are doing it here for simplicity and given that we are using a local SQLite database.
This project should be used with the movies.db
database in data/
folder. It is the same database that we used in the previous exercise. You can download a fresh database here or from CS50.
We can run migrations with the following command:
npm run migrate:latest
In development mode:
npm run dev
In production mode:
npm run start
If you make changes to the database schema, you will need to update the types. You can do this by running the following command:
npm run generate-types