{"id":26455667,"url":"https://github.com/alexdisdier/short-url-api","last_synced_at":"2026-04-11T09:32:22.657Z","repository":{"id":53910409,"uuid":"179166691","full_name":"alexdisdier/short-url-api","owner":"alexdisdier","description":"This is an APi for a shorten url open source web app. Built it using NodeJS","archived":false,"fork":false,"pushed_at":"2021-03-11T16:35:01.000Z","size":59,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-18T20:55:59.382Z","etag":null,"topics":["body-parser","compression","cors","express","graphql","helmet","javascript","jest","mongodb","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://short-url-alex-disdier.herokuapp.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexdisdier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-02T22:13:40.000Z","updated_at":"2023-03-07T03:28:23.000Z","dependencies_parsed_at":"2022-08-13T04:01:09.895Z","dependency_job_id":null,"html_url":"https://github.com/alexdisdier/short-url-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexdisdier/short-url-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdisdier%2Fshort-url-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdisdier%2Fshort-url-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdisdier%2Fshort-url-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdisdier%2Fshort-url-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexdisdier","download_url":"https://codeload.github.com/alexdisdier/short-url-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdisdier%2Fshort-url-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263450009,"owners_count":23468154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["body-parser","compression","cors","express","graphql","helmet","javascript","jest","mongodb","nodejs","typescript"],"created_at":"2025-03-18T20:56:05.198Z","updated_at":"2026-04-11T09:32:17.612Z","avatar_url":"https://github.com/alexdisdier.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://semaphoreci.com/api/v1/alexdisdier/short-url-api/branches/master/shields_badge.svg)](https://semaphoreci.com/alexdisdier/short-url-api)\n\n# Synopsis\n\nThis is an APi for my shorten url open source web app. I built it using NodeJS.\n\nYou will find three branches:\n\n- **master** using Typescript, REST API and GraphQL, unit test with Jest\n- **javascript** first version of this project using only REST API, witout unit test\n- **GraphQL** converting REST API into GraphQL\n\n* See source code of front-end built with React - https://github.com/alexdisdier/short-url\n\n## ✅ Functionalities\n\n- Route to shorten url\n\n  - Checking if it's a valid URL\n  - Checking if it's missing http - https\n  - Creating in MongoDB new URL object\n\n- Route to redirect the short url\n  - Find the short url\n  - redirect to original url\n- Route to update the number of visits to a url\n  - Find by id the url\n  - Increment + 1 the number of visits\n\n## Directory Structure\n\n```bash\n\nshorten-url-api\n├── dist\n├── src\n│   ├── constant\n│   ├── app.ts\n│   ├── server.ts\n│   └── url.ts\n├── test\n├── .gitignore\n├── README.md\n├── jest.config.js\n├── package.json\n└── tsconfig.json\n\n```\n\n## Running the project\n\nClone this repository :\n\n```bash\ngit clone https://github.com/alexdisdier/short-url-api.git\n\ncd shorten-url-api\n```\n\nTest different branches:\n\n```bash\ngit checkout javascript\ngit checkout GraphQL\n```\n\nStart the server:\n\n```bash\nnpm run dev\n```\n\nTest the api:\n\n```bash\nnpm run test:unit\n```\n\nBuild the app:\n\n```bash\nnpm run build\n```\n\nOpen Postman to test it out. Your data will be saved to MongoDB.\n\nIf you're on the graphQl branch, you can use graphiql.\n\n## Built With\n\n- [JavaScript](https://developer.mozilla.org/bm/docs/Web/JavaScript)\n- [Node.js](https://nodejs.org/en/)\n- [Express.js](https://expressjs.com/)\n- [MongoDB](https://www.mongodb.com/)\n\n## Testing With\n\n- [Postman](https://www.getpostman.com/)\n\n## Dependencies\n\n- [express](https://www.npmjs.com/package/express)\n- [mongoose](https://www.npmjs.com/package/mongoose)\n- [body-parser](https://www.npmjs.com/package/body-parser)\n- [compression](https://www.npmjs.com/package/compression)\n- [helmet](https://www.npmjs.com/package/helmet)\n- [cors](https://www.npmjs.com/package/cors)\n- [uid2](https://www.npmjs.com/package/uid2?activeTab=versions)\n- @types/...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdisdier%2Fshort-url-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexdisdier%2Fshort-url-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdisdier%2Fshort-url-api/lists"}