moonsight
TypeScript icon, indicating that this package has built-in type declarations

0.1.22 • Public • Published

API

##demo > copy startup.js to your project

Kernel opts

{
  apiPath: '',
  port: PORT,
  logging: {
    error: true,
    http: true
  }
}

Kernel init

const cxt = await Kernel(opts);

Handlers

  • Http

    • export const ihttp = IHttp(handler, middlewares)
  • Socket

    • export const isocket = ISocket(handler, middlewares)
  • Kernel core

    • export const ikernel = IKernel(handler, middlewares)

Responses

  • Basic Response

    • Response(data, { message = '', status = 200 });
  • Not Found Response

    • NotFound({ message = '' });
  • Paginated Response

    • PaginatedResponse(data, { message = 'success', status = 200 })
  • Unhandled Response

    • UnhandledReponse(err)
  • Empty Response

    • EmptyResponse();

Readme

Keywords

none

Package Sidebar

Install

npm i moonsight

Weekly Downloads

5

Version

0.1.22

License

GPL

Unpacked Size

147 kB

Total Files

115

Last publish

Collaborators

  • mikemasam