This repository contains multiple micro-services templates that can be easily cloned and used for different purposes, such as URL shortening, timestamp validation, file metadata extraction, and exercise tracking. Each service is built with Node.js and can be quickly set up by following the steps below.
- URL Shortener: Shorten URLs and manage redirects.
- Timestamp Validator: Validate and parse timestamps in various formats.
- File Metadata Finder: Extract metadata (size, type, etc.) from uploaded files.
- Exercise Tracker: Track exercises with user data, including duration, type, and timestamps.
- Header Parser: Gives us the details about the user who gives requests.
To use any of these micro-services, follow the steps below:
git clone https://github.com/<your-username>/micro-services-templates.git
cd micro-services-templates
Each service has its own directory. Navigate to the one you want to use:
-
URL Shortener:
cd urlshortener
-
Timestamp Validator:
cd timestamp
-
File Metadata Finder:
cd filemetadata
-
Exercise Tracker:
cd exercisetracker
Header Parser:
cd headerparser
Inside the service directory, install the required dependencies using npm:
npm i
After installing dependencies, start the server:
node index.js
The server will start running on the default port (usually http://localhost:3000
).
- Node.js (v14 or higher)
- npm (v6 or higher)
Once the server is up, you can use your preferred API testing tool (like Postman or Curl) to interact with the micro-services. Each service will have its own API endpoints.
Feel free to contribute by adding new micro-services or improving the existing ones. To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a pull request.
By following this guide, you'll be able to run and test any of the micro-services in this repository with ease.