Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

cds-snc/next-holidays

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Next Holidays

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/

Getting started

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.

Build and run with npm

# 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 linting

# run code linter
npm run lint

Build and run as a Docker container

# 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.

Overriding the default port number or API URL

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