Skip to content

URL shortener microservice in NodeJS - ExpressJS - MongoDB - AWS Lambda - AWS Gateway

Notifications You must be signed in to change notification settings

Gahbr/URL-Shortener

Repository files navigation

Status: Finished

AboutLayoutUser StoriesPre-requisitesTech Stack

About

A Nodejs Microservice that shortens URL's. This project was proposed as a challenge in freecodecamp's "Back End Development and APIs" course. Link : https://shortenmylink.herokuapp.com


Layout

Screenshot 2022-08-31 at 21-31-36 URL Shortener Microservice Node js


User Stories

  • The API endpoint is GET [project_url]/api/shorturl/

  • You can POST a URL to /api/shorturl and get a JSON response with original_url and short_url properties. Here's an example: {original_url:'https://freeCodeCamp.org', short_url : 1}

  • When you visit /api/shorturl/<short_url>, you will be redirected to the original URL.

  • If you pass an invalid URL that doesn't follow the valid http://www.example.com format, the JSON response will contain{ error: 'invalid url' }


Pre-requisites

Before you begin, you will need to have the following tools installed on your machine: Git, Node.js. In addition, it is good to have an editor to work with the code like [VSCode] (https://code.visualstudio.com/)

Running the application (server)

# Clone this repository
$ git clone https://github.com/Gahbr/URL-Shortener
# Access the project folder cmd/terminal
$ cd URL-Shortener
# install the dependencies
$ npm install
# Run the application in development mode
$ npm run dev
# The server will start at port: 3000 - go to http://localhost:3000

Tech Stack

The following tools were used in the construction of the project:

See the file package.json

Server


About

URL shortener microservice in NodeJS - ExpressJS - MongoDB - AWS Lambda - AWS Gateway

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published