1.1.29 • Published 2 years ago

@umukorog-tickets/common v1.1.29

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

@umukorog-tickets/common


@umukorog-tickets/common is a javascript package for managing communications within microservice.

It contains functionalities for NATS server management, authentication and Error handling. This NPM module provides developers with a robust toolkit for managing NATS servers seamlessly, implementing secure authentication strategies, and ensuring resilient error handling. Its flexibility and adaptability make it an invaluable asset for projects requiring reliable and secure communication in distributed systems.

Key Features


  • NATS Server Management
    • Provides seamless integration with Node.js projects for simplified server management
  • Authentication Module
    • Includes authentication to ensure secure commmunications between services.
  • Error Handling
    • Customizable error responses to ensure grateful degradation in case of communication failures

Installing


For the latest stable version, run:

npm


npm install @umukorog-tickets/common

Usuage


import express, { Request, Response } from 'express';
import { NotFoundError, requireAuth, validateRequest } from '@umukorog-tickets/common';
import { Ticket } from '../models/ticket';

const router = express.Router();

router.post(
  '/api/route',
  requireAuth,
  validateRequest,
  async (req: Request, res: Response) => {
    const { ticketId } = req.body;

    const ticket = await Ticket.findById(ticketId);
    if (!ticket) {
      throw new NotFoundError();
    }

    res.send(ticket);
  }
);

export { router as newOrderRouter };

Keywords


@umukorog-tickets/common

1.1.29

2 years ago

1.1.28

2 years ago

1.1.27

2 years ago

1.1.25

2 years ago

1.1.23

2 years ago

1.1.24

2 years ago

1.1.22

2 years ago

1.1.21

2 years ago

1.1.19

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.20

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.5

2 years ago

1.0.0

2 years ago