api.noahjahn.dev was made to track how many unique visitors come to noahjahn.dev, how often they access the site, where they are accessing it from, and their preference of dark/light mode.
- Localhost: http://localhost/
- Production: https://api.noahjahn.dev/
To run this code you'll need to
- use a UNIX operation system
- have Docker installed
Locally, using docker is the easiest and fastest way to get up and running. The docker-compose.yml
file will start the following services for you:
- Nodejs Alpine container mapped to port 8000
- MongoDB mapped to port 27017
The local database credentials are set in the docker-compose.yml
file:
- Username: root
- Password: Codingisfun
- Clone the repository and change directory into the cloned repo
git clone [email protected]:noahjahn/api.noahjahn.dev.git
cd api.noahjahn.dev
- Copy
.env.example
to.env
, it includes local credentials for using the docker services
cp .env.example .env
- Start docker containers
docker-compose up
- Once complete, you can being developing in a live reloading environment provided by nodemon
docker-compose up
You can use the -d flag runs the containers in a detached state so you can continue to use your terminal, but you won't see console.log output from the application
Ctrl + C
Then, you still need to bring containers down
docker-compose down