@nedvisol/hexagon-core
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Hexagon

Hexagon is a tool to help you build portable node micro/nano-services to be deployed as a service or cloud functions.

Overview

This core package defines the decorators used by the library, to annotate Typescript classes for RESTful web services mapping.

See full documentation

The motivation behind this library is to help make your Node microservice code more portable, between web frameworks (such as Express or Koa) or Serverless model with cloud functions. We believe in the Hexagonal architecture where your core business logic should be loosely-coupled with the presentation interface and the underlying services.

Example

Install Hexagon via NPM

$ npm install @nedvisol/hexagon-core

Write your first controller by creating a plain-old Typescript class and annotate

// index.ts
import { RestController, RestGetMapping, RestPathParam } from '@nedvisol/hexagon-core';
@RestController()
export class UserController {  
 
  @RestGetMapping('/users/:id')
  getUser (@RestPathParam('id') id: string): IUser {
    return { id, name: 'test' };
  }
}

/@nedvisol/hexagon-core/

    Package Sidebar

    Install

    npm i @nedvisol/hexagon-core

    Weekly Downloads

    2

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    14.8 kB

    Total Files

    15

    Last publish

    Collaborators

    • nedvisol