{"id":17766137,"url":"https://github.com/thedevelop3r/url-shortner","last_synced_at":"2025-07-14T01:13:44.470Z","repository":{"id":56863692,"uuid":"526626420","full_name":"Thedevelop3r/url-shortner","owner":"Thedevelop3r","description":"this project was a challenge at freecodecamp for url shortning | i used mongoose as database some extra packages and wrote its logic , passed the test","archived":false,"fork":false,"pushed_at":"2022-08-19T18:27:49.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-07T08:48:52.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Thedevelop3r.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-19T13:50:49.000Z","updated_at":"2022-08-19T13:59:42.000Z","dependencies_parsed_at":"2022-08-21T14:00:46.131Z","dependency_job_id":null,"html_url":"https://github.com/Thedevelop3r/url-shortner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thedevelop3r%2Furl-shortner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thedevelop3r%2Furl-shortner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thedevelop3r%2Furl-shortner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thedevelop3r%2Furl-shortner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thedevelop3r","download_url":"https://codeload.github.com/Thedevelop3r/url-shortner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246651499,"owners_count":20811991,"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":[],"created_at":"2024-10-26T20:23:47.537Z","updated_at":"2025-07-14T01:13:44.459Z","avatar_url":"https://github.com/Thedevelop3r.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URL Shortener Microservice\n\nThis is the boilerplate code for the URL Shortener Microservice project. Instructions for building your project can be found at https://www.freecodecamp.org/learn/back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice.\n\n---\n\n# URL Shortener\n\nThis project is a solution to a FreeCodeCamp challenge for building a URL shortener service. It uses Node.js, Express, and MongoDB (via Mongoose) to provide a simple web API for shortening URLs. The application includes additional logic and packages to meet challenge requirements and all tests have been passed.\n\n## Features\n\n- Shorten long URLs to concise short links\n- Store and retrieve URLs using MongoDB with Mongoose\n- RESTful API endpoints\n- Fully passes FreeCodeCamp test suite\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js (v14 or later)\n- npm\n- MongoDB (local or Atlas)\n\n### Installation\n\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/Thedevelop3r/url-shortner.git\n   cd url-shortner\n   ```\n\n2. **Install dependencies:**\n   ```bash\n   npm install\n   ```\n\n3. **Set up environment variables:**\n\n   Create a `.env` file in the root directory and add your MongoDB URI:\n   ```\n   MONGO_URI=your_mongodb_connection_string\n   PORT=3000\n   ```\n\n4. **Start the application:**\n   ```bash\n   npm start\n   ```\n   The server will run on `http://localhost:3000` by default.\n\n## API Endpoints\n\n- **POST `/api/shorturl`**\n  - Request Body: `{ \"url\": \"https://example.com\" }`\n  - Response: `{ \"original_url\": \"https://example.com\", \"short_url\": 1 }`\n\n- **GET `/api/shorturl/:short_url`**\n  - Redirects to the original URL corresponding to the provided short URL code.\n\n## Technologies Used\n\n- JavaScript (Node.js, Express)\n- MongoDB \u0026 Mongoose\n- CSS (for any frontend)\n- Shell scripts (for automation tasks)\n\n## License\n\nThis project is open-source and available under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedevelop3r%2Furl-shortner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthedevelop3r%2Furl-shortner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedevelop3r%2Furl-shortner/lists"}