1.0.3 • Published 6 years ago

@pan-os/heimdall v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Heimdall CI status

An organizational and modular approach to handle pseudo microservices into restify applications.

Motivation

The whole idea behind this project is to allow you to manage your API using a structure easy to maintain and split into several packages, heimdall wants to transform your mindset to microservices and help you to keep everything in place.

Installation

$ yarn add @pan-os/heimdall

Requirements

TBD

  • Restify

Usage

Routes entrypoint

/**
 * Module Dependencies
 */
const Heimdall = require('heimdall');
/**
 * Pseudo microservices
 */
const { user } = require('../services');

module.exports = (server) => {
  // Attach microservices to /
  Heimdall.attachMicroservice(server, user);
};

Services folder structure

Represents your microservices

Example Service Structure

// index.js

module.exports = [
  {
    method: 'post',
    path: '/user/register',
    action: (req, res, next) => { ... }
  }
];

// And you will be able to do a post to http://localhost:3000/user/register and 
// also should be able to manipulate/create your response into your action callback

Development

$ yarn start:[env] (dev, prod)

Contributors 🎉

Thanks goes out to all these wonderful people (emoji key):

Sérgio Freitas

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT