Skip to content

RenanTRS/url-shortener-dio

Repository files navigation

Logo bootcamp spread

URL Shortener

This project is my fourth bootcamp spread challenge.

GitHub License GitHub top language GitHub last commit GitHub issues open GitHub closed issues GitHub pull request open GitHub closed pull requests

How to use

To clone and run this project, you'll need Git, node v14.20.0 or higher + yarn v1.22.15 or higher installed on your computer. From your command line:

#Clone this repository
$ git clone https://github.com/RenanTRS/url-shortener-dio

#Go into the repository
$ cd url-shortener-dio

#Install dependencies
$ yarn
#or
$ npm i

#Run
$ yarn dev
#or
$ npm run dev

#Build
$ yarn build
#or
$ npm run build

#Run build
$ yarn start
#or
$ npm run start

.ENV

BASE_URL: your_baseurl_here
MONGO_URI: your_stringconnection_database_here

Routes:

POST: http://<yourbaseurl>/shorten

Request (body):

{
  "originURL": "https://www.npmjs.com"
}

Response:

{
  "_id": "62ca10afd21ae74c7ff28cc0",
  "hash": "GkSYmaFoU",
  "originURL": "https://www.npmjs.com",
  "shortURL": "http://localhost:3333/GkSYmaFoU",
  "__v": 0
}

GET: http://<yourbaseurl>/hash-generated - (shortURL)

Built with

Contact

License

This project is licensed under the MIT License - see the LICENSE file for details.