dailycat is a fun project where cats with inspirational quotes get posted everyday!
This project was powered by express generator, in order to run this project you will need node installed and mongodb.
For this project you need to add a .env
file in the root of the project, for this instance we only need two variables, our database url and our cat api key (you can skip this key, but it has some restrictions).
MONGO_DB_URL=mongodb://127.0.0.1:27017/test
CAT_API_KEY=<Your-Cat-API-key>
- You first need to install node dependencies.
npm install
- To add data to your database you can run either of our commands in
src/db/startup/
.
- To insert just one element, you can use the following command:
ts-node src/db/startup/insertOne
- or if you wanna insert multiple elements, you can use:
ts-node src/db/startup/insertMany
- Copy public folder
npm run copy-public
- Copy views folder
npm run copy-views
- Run the following command and go to your browser on
localhost:3000
.
npm run dev