Skip to content

PratikNayak-DEV/URL-Shortner

Repository files navigation

URL Shortener

A simple URL shortener application built with Node.js, Express, and MongoDB.

Table of Contents

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/url-shortener.git
    cd url-shortener
  2. Install the dependencies:

    npm install
  3. Start the MongoDB server (make sure MongoDB is installed and running on your machine):

    mongod
  4. Start the application:

    npm start

Usage

Once the server is running, you can use the API to shorten URLs.

Example

To shorten a URL, send a POST request to http://localhost:8001/url with a JSON body containing the URL to be shortened:

{
  "url": "https://www.example.com"
}

Project Structure

url-shortener/
├── .gitignore
├── connect.js
├── controllers/
│   └── url.js
├── index.js
├── models/
│   └── url.js
├── package.json
├── readme.md
└── routes/
    └── url.js

About

URL Shortner using node ,express and mongodb.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published