@godgiven/type-server
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

@godgiven/type-server

A base server app with very simple routing and middleware. you can install type-server with:

yarn add @godgiven/type-server

Uses

// For define app
import { App } from '@godgiven/type-server';

// For Rigister function
import { ServerResponse, IncomingMessage } from 'http';
import { sendResponse } from '@godgiven/type-server';


const app = new App();
app.port = 5000;
app.version = 'v1';

app.register('GET', '/', async (_request: IncomingMessage, response: ServerResponse): Promise<void> =>
{
  sendResponse(response, 200, {
    ok: true,
    description: '..:: Welcome ::..',
  });
});

Readme

Keywords

none

Package Sidebar

Install

npm i @godgiven/type-server

Weekly Downloads

0

Version

0.4.0

License

Apache-2.0

Unpacked Size

13.2 kB

Total Files

28

Last publish

Collaborators

  • asmanp2012