API to handle url shortener functionality
Based on Nest framework TypeScript starter repository.
$ npm install
Create .env
file (.env.test
or .env.template
could be used as base)
This will start the required componentes and start the app on port 80 (configued by .env
file)
It requires to create the .env
file.
docker-compose -f docker-compose.yml up
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Note - to run e2e tests, rabbitmq is required (run docker-compose up rabbitmq
)
Check if the project is runing
Create if no exists and return the short version for the income url
Redirect to the original url linked to the "token" value
On local machine, even when base url is set to http://tier.app
, to test the functionality, we need to use http://localhost
(this can be set on .env files)