Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amaui/api

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amaui/api

API

  • 1.0.38
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

amaui logo

amaui API

API


MIT license     Production ready     100% test cov     Nodejs

Very simple code     Modern code     Junior friendly     Typescript     Made with :yellow_heart:


Getting started

Add

  yarn add @amaui/api

Use

  import express from 'express';
  import { Route, Method, IRouteClassInstance, Routes } from '@amaui/api';

  class Base implements IRouteClassInstance {

    public response(req: express.Request, response: express.Response, options: { method: 'json' | 'send', type: 'application/json', }) { return ...; }

    public error(req: express.Request, error: Error) { return ...; }

  }

  // Add decorator to a class representing a route
  @Route(
    '/a',
    method
  )
  class A extends Base {

    @Method(
      'get',
      '/a',
      method1
    )
    public a() { }

  }

  // Create an express app
  const app = express();

  // Register all classes as app routes
  Routes([A], app);

  // app routes:
  // GET /a/a, middlewares: method, method1

  // etc.

Dev

Install

  yarn

Test

  yarn test

Prod

Build

  yarn build

Keywords

FAQs

Package last updated on 26 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc