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

1.4.2 • Public • Published

This library only supports TypeScript.


Installation

Using npm

npm install nnvc --save

Using yarn

yarn add nnvc

Basic Usage

Add this script in your package.json

{
  "dev": "nodemon --watch src --ext ts,json --exec 'ts-node src/index.ts'"
}

Creating a server

import { Server } from 'nnvc/server'

class ApplicationServer extends Server {
  protected port: number = 3000

  constructor() {
    super()
  }
}

const app = new ApplicationServer()
app.start()

Now, let's create a controller

import { IncomingHttpHeaders } from 'http'
import { Controller, Get, Status } from 'nnvc'

@Controller('/')
export class IndexController {
  @Get('/ping')
  @Status(200)
  public async ping() {
    return {
      msg: 'pong',
    }
  }
}

After creating a controller, you have to register it in the server

class ApplicationServer extends Server {
  protected port: number = 3000

  constructor() {
    super()

    this.register(IndexController)
  }
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.4.21latest

Version History

VersionDownloads (Last 7 Days)Published
1.4.21
1.4.10
1.4.00
1.3.60
1.3.40
1.3.30
1.3.10
1.3.00
1.2.60
1.2.50
1.2.40
1.2.31
1.2.21
1.2.11
1.2.01
1.1.101
1.1.90
1.1.80
1.1.70
1.1.60
1.1.50
1.1.40
1.1.30
1.1.20
1.1.10
1.1.00
1.0.01

Package Sidebar

Install

npm i nnvc

Weekly Downloads

7

Version

1.4.2

License

MIT

Unpacked Size

36.7 kB

Total Files

78

Last publish

Collaborators

  • cardeer