A simple Express web app that shortens long urls and provides custom QR codes for the newly created short url. This app uses EJS as the template engine to render 3 views:
The application currently uses MongoDB (or Amazon DocumentDB) to store the following information:
The following configuration variable keys are used and stored in a config.json file:
Key | Value |
---|---|
cognitoLoginUrl | Example: https://[coginto-domain-prefix].auth.[region].amazoncognito.com |
cognitoClientId | Example: zam0d9r8i22h6fjl11c7cn3a0 |
siteUrl | Example: s18s.io |
The following environment variable keys are used and stored in a .env file:
Key | Value |
---|---|
MONGODB | Default formate: mongodb://url-here/dbName-here |
AWS_DEFAULT_REGION | Example: us-east-1 |
NODE_ENV | Example: Production |
PORT | Example: 80 |
COGNITO_USER_POOL_ID | Example: us-east-1_InV89Oqpl |
COGNITO_CLIENT_SECRET | Example: 324u3q48psm4g8hpo576vdji1sfmtdjk8lv1vbe28hneslhk20p |
npm install
cp .env_sample .env
docker run -it -d -p 27017:27017 --name mongodb mongo
MONGODB
will be mongodb://localhost:27017/urlShortener
config.json
and .env
files located in the root of this project.MONGODB=mongodb://localhost:27017/urlShortener
)npm run devStart
To be added...
config.json
and .env
files are up to date with the correct variables.docker-compose build --no-cache && docker-compose up
docker context create ecs ecs
docker context use ecs
docker build . -f Dockerfile -t jldeen/shorturl:v5 && docker push jldeen/shorturl:v5
(Note: If using macOS M1, remember to add the --platform linux/amd64
flag to the build command)image
in docker-compose-ecs.yml
with the image you just built and pushed to your repodocker compose -f docker-compose-ecs.yml up
See the issues for opportunities to collaborate.