Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/renantrs/url-shortener-dio
Projeto desafio Encurtador de links - DIO
https://github.com/renantrs/url-shortener-dio
express mongodb nodejs typescript
Last synced: about 1 month ago
JSON representation
Projeto desafio Encurtador de links - DIO
- Host: GitHub
- URL: https://github.com/renantrs/url-shortener-dio
- Owner: RenanTRS
- License: mit
- Created: 2022-07-06T16:50:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-10T00:40:35.000Z (over 2 years ago)
- Last Synced: 2024-10-24T14:25:53.990Z (3 months ago)
- Topics: express, mongodb, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 154 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
URL Shortener
This project is my fourth bootcamp spread challenge.
## How to use
To clone and run this project, you'll need **[Git](https://git-scm.com)**, **[node v14.20.0](https://nodejs.org/en/)** or higher + **[yarn v1.22.15](https://yarnpkg.com)** or higher installed on your computer. From your command line:
```bash
#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:///shorten`Request (body):
```json
{
"originURL": "https://www.npmjs.com"
}
```Response:
```json
{
"_id": "62ca10afd21ae74c7ff28cc0",
"hash": "GkSYmaFoU",
"originURL": "https://www.npmjs.com",
"shortURL": "http://localhost:3333/GkSYmaFoU",
"__v": 0
}
```**GET:**
`http:///hash-generated` - _(shortURL)_## Built with
- [NodeJs](https://nodejs.org/en/)
- [TypeScript](https://www.typescriptlang.org/)
- [Express](http://expressjs.com/)
- [ts-node-dev](https://www.npmjs.com/package/ts-node-dev)
- [Babel](https://babeljs.io/)
- [MongoDb](https://www.mongodb.com/)
- [Mongoose](https://mongoosejs.com/)
- [ShortId](https://www.npmjs.com/package/shortid)
- [DotEnv](https://www.npmjs.com/package/dotenv)
- [EsLint](https://eslint.org/)
- [Prettier](https://prettier.io/)## Contact
- Email me - [email protected]
- Connect with me on [LinkedIn](https://www.linkedin.com/in/renantrsouza/)## License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/renantrs/url-shortener-dio/blob/main/LICENSE) file for details.