This is a very tiny Next.js frontend that reads from the hols API for Canadian statutory holidays. It will tell you your next provincial or federal holiday, and doesn't do much else.
Try it out π https://next-holidays.azurewebsites.net/
npm
is a javascript package manager. It downloads project dependencies and runs node applications.
A docker container allows a developer to package up an application and all of its parts. This means we can build an app in any language, in any stack, and then run it anywhere β whether locally or on a server.
# install dependencies
npm install
# run application in 'dev' mode
npm run dev
# run application in 'prod' mode
npm run build && npm start
On a Mac, press Control
+ C
to quit the running application.
# run code linter
npm run lint
# build an image locally
docker build -t pcraig3/next-holidays .
# run the container
docker run -it -p 80:80 pcraig3/next-holidays
On a Mac, press Control
+ C
to quit the running docker container.
The Dockerfile sets default values for PORT
(80
) and API_URL
(https://canada-holidays.ca/api
).
To override either or both of these environment variables at runtime, pass in the new variable after the -e
flag when booting up the container.
# override the port number and the API_URL
docker run -it -e PORT=3000 -e API_URL=https://example.com -p 80:3000 pcraig3/next-holidays