1.4.2 • Published 2 years ago
nnvc v1.4.2
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)
}
}
1.4.2
2 years ago
1.4.1
2 years ago
1.4.0
2 years ago
1.3.6
2 years ago
1.3.4
2 years ago
1.3.3
2 years ago
1.3.1
2 years ago
1.3.0
2 years ago
1.2.6
2 years ago
1.2.5
2 years ago
1.2.4
2 years ago
1.2.3
2 years ago
1.2.2
2 years ago
1.2.1
2 years ago
1.2.0
2 years ago
1.1.10
2 years ago
1.1.9
2 years ago
1.1.8
2 years ago
1.1.7
2 years ago
1.1.6
2 years ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.0
2 years ago