This repo contains code for an JavaScript/ Node.js website that utilizes an Express server, and EJS view engine to present users with a random photo of a dog, and a random short poem about a dog every time they visit the website.
This application can also be deployed in a container using Docker.
The purpose of this project is simple. I love dogs, I love poetry, and I have a feeling others might too. I also wanted to practice designing, building, and deploying, and documenting a Node application that utilizes external APIs and Server Side Rendering within a limited time frame.
Node Version 18.17.0 or Later
A Web browser of your choice
Express
EJS
Docker
-
Clone this repo to your machine.
-
cd into the dogs-and-poems directory
-
There are three different ways to set up and start the application:
- Install Node Version Manager in Environment
nvm install 18.17.0 -g nvm use 18.17.0
- Install Dependencies
npm ci -y
- Start the app
npm run start
- Open in browser
open http://localhost:3000
- After navigating to dogs-and-poems directory, run the following commands in the terminal:
chmod +x start.sh
source start.sh
This application can be deployed locally using Docker (Docker must be installed on your machine):
- To build the image, navigate to the the dogs-and-poems directory and in the terminal run:
docker build --tag 'dog-poem-app' .
- After build completes, run the following command to start the app:
docker run -p 3000:3000 dog-poem-app
- Navigate to https://localhost:3000 in your web browser and refresh the page.