Skip to content

It is a set of different Microservice APIs built using Express JS, MongoDB which serve different purpose like providing Timestamp in UNIX and UTC formats, Request Header parsing to provide client info, Shorten URL for ease to use

Notifications You must be signed in to change notification settings

saideepd/microservice-utility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservice Utility

It is a set of different Microservice APIs built using Express JS which serve different purpose.

These microservices are built as a part of freeCodeCamp Backend Development and APIs project.

Different microservices available are:

1. Timestamp Microservice API

Timestamp Microservice API parses the input date and returns the UNIX and UTC timestamps for the provided input.

Access the API using either of these 2 services:

Example Usage:

Example Output:

{
    "unix": 1642204800000,
    "utc": "Sat, 15 Jan 2022 00:00:00 GMT"
}

Screenshot:

Timestamp Microservice API

2. Who Am I Microservice API

Who Am I Microservice API is a Request Header Parser that provides client information of the user consuming the API. It provides the Client's IP address, Browser Language and the Browser's User Agent used for browsing the internet.

Access the API using either of these 2 services:

Example Usage:

Example Output:

{
  "ipaddress": "183.87.11.36",
  "language": "en-GB,en-US;q=0.9,en;q=0.8",
  "software": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
}

Screenshot:

Who Am I Microservice API

3. URL Shortener Microservice API

URL Shortener Microservice API is a service that helps you to shorten your lengthy website URLs with simple shorter URLs that are easy to remember & quick to type. This service uses MongoDB as database to store & retrieve the URLs.

Access the API using either of these 2 services:

Example Usage:

Example Output:

{
  "original_url": "https://www.freecodecamp.org/",
  "short_url": 1
}

Screenshot:

URL Shortener Microservice API

4. File Metadata Microservice API

File Metadata Microservice API is a service that helps you to analyse your files by knowing its metadata. This app provides a simple UI to upload your files & the API provides information of the file like its name, type & size. The API uses Multer as a middleware to handle file uploads. Currently the API is configured to only accept files below 10 Mb in size due to server limitations, but that can be configured as per requirements & server plans.

Access the API using either of these 2 services:

Example Usage:

Example Output:

{
  "name": "github_icon_grey.png",
  "type": "image/png",
  "size": 224
}

Screenshot:

File Metadata Microservice API


This project taught me the following new skills:

  • Netlify Serverless Functions
  • Limiting the number of requests per minute to avoid crossing any cloud service's plan limits
  • Simple way to build APIs using ExpressJS
  • DOM Manipulation using JavaScript
  • Connecting to & using MongoDB as a database for a web app
  • Using Mongoose library to interact with MongoDB
  • Validating of URL using Node's inbuilt DNS library
  • Using Multer library as a middleware to handle file uploads
  • Storing the files to either Disk or Memory using multer
  • Limiting the size of files allowed to be uploaded using multer & body-parser
  • Learnt about HTML events like onload, onbeforeunload, onformchange, etc.

Screenshot:

Microservice Utility APIs Homepage

About

It is a set of different Microservice APIs built using Express JS, MongoDB which serve different purpose like providing Timestamp in UNIX and UTC formats, Request Header parsing to provide client info, Shorten URL for ease to use

Topics

Resources

Stars

Watchers

Forks